How to build your first Android app?


#1

Hi,

I’m thinking loud here… do we have some sort of super light version of Lucee that supports mobile app dev?

Specifically I want to do the following ( have never created any mobile app before )

create some simple Android app that will support the following functionality:
(1) provide static information to the user
(2) provide html FORM for data input including file upload from the user
(3) process data resulted from form action response or other types of request
(4) support cfhttp call
(5) support local file read/write

Note:
No database query necessary at this point.

Many thanks.


#2

Usually the way this works is that the mobile app connects to a backend server. The server often exposes a REST api for the mobile app to talk to. The front end is the mobile app (think what the browser does, JavaScript / HTML). The backend server can be running Lucee, but it doesn’t need to do anything special to serve a mobile app, any server will do - you just expose a API to the client.

Lucee/CFML is a server side technology, mobile apps are a client - so you should use client side tech. If you are new to mobile app dev, you might checkout Cordova which allows you to build the app using HTML/JavaScript, if you are going to get more serious you might checkout Ionic Framework which is built on top of Cordova. Cordova will provide plugins which you can use to access the native device APIs from JavaScript, for example you can use cordova-plugin-file to access the device file system.

Perhaps you knew all that and just wanted to know if there is a light version of lucee, there is Lucee Light, which is what fuseless.org uses it doesn’t have any extensions installed and just provides the core language features (file access and cfhttp work).


#3

Thanks Peter. I had vague notion of what you described, you brought clarity to my understanding.
Btw, I’ve never created any mobile app before.
Upon a quick search, Corda was bought by Adobe and rebranded as PhoneGap and released as open source.
I took a quick at both Cordova and PhoneGap, the former seems cleaner ( easy to understand ).
https://cordova.apache.org/
All good with its Step 1 thru 4 but for its Step 5, how to compile an Android app or even iPhone app out of it?
Ok, with the following URL, so, after we build an app for Android, how do we create a .apk app so that Android users can download and install it?
https://cordova.apache.org/docs/en/latest/guide/cli/#build-the-app

Many thanks.


#4

Ok, I’m getting started with cordova now. Currently I only want to dev my first-mobile-app for Android.
cordova is installed via npm since I have node.js installed already.

Running the following command for requirements check
cordova requirements

Java JDK: not installed
Failed to run “javac -version”, make sure that you have a JDK installed.
You can get it from: http://www.oracle.com/technetwork/java/javase/downloads.

but
java -version
java version “1.8.0_191”
Java™ SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot™ Client VM (build 25.191-b12, mixed mode, sharing)

it’s said Java JDK is a subset of Java SE, so, I would guess Java JDK is also installed.
In the meantime, I took a look at my {Java installation} bin directory, and indeed I don’t any javac.* executable, so, how do we fix it?

Thanks.


#5

More details.

My OS is windows 10 (64bit).

Downloaded and installed Java SDK, set up JAVA_HOME and updated path.
java -version
returns
java version “1.8.0_191”
Java™ SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot™ 64-Bit Server VM (build 25.191-b12, mixed mode)

however,

javac -version failed,
err msg:
‘javac’ is not recognized as an internal or external command,
operable program or batch file.

echo %JAVA_HOME% returns
C:\Program Files (x86)\Java\jdk

echo %PATH% returns
C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files\Git\cmd;C:\Users\userX\go\bin;C:\Program Files\nodejs;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;C:\WINDOWS\System32\OpenSSH;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn;C:\Program Files\Microsoft SQL Server\140\Tools\Binn;C:\Program Files\Microsoft SQL Server\140\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio;C:\Program Files (x86)\Java\jdk\bin;C:\Users\userX\AppData\Local\Microsoft\WindowsApps;C:\Users\userX\go\bin;C:\Users\userX\AppData\Roaming\npm;C:\Users\userX\AppData\Local\Microsoft\WindowsApps

How to fix it?
Thanks.


#6

Other way round. SE is a subset of JDK. So you don’t have the JDK .


#7

You’re correct in that the very first I downloaded SE but then I realized, shoot, wrong guy, so, I downloaded and install jdk-8u191-windows-x64

Windows indicates Java SE Development Kit 8 Update 191

could the existing SE cause problem?

Thanks.