Notes for Android Mobile App Developers

Notes for Android Mobile App Developers

To generate android application (.apk file) from the source code the following things are needed.

  1. Android SDK (21 or above)

  2. Android Studio (1.4 or above)

  3. Sqlite (to prepare/update categories list for app)

First of all we need to update the website link in android source code from which the app will be linked. For this open "CvSettings.java" file under following path : <android app source/trunk folder>/app/src/main/java/com/crowdvox/apps/crowdvoxandroid/ and replace the website url in getServerUrl().

In next step, we have to create the categories list for mobile application.

Then enable debug mode on your website by editing app/config/core.php and change debug mode to 2 from 1 or 0.

Next, log in with Admin credentials into your website and open the following url:

<your-website-domain>/admin/categories/mobileSqlite

It will provide a create and insert statement(s) for categories table. Copy all insert statements.

Now open categories.sqlite file under following path: <android app source/trunk folder>/app/src/main/assets/ (using sqlite browser or other tool) and truncate existing data from categories table and execute the copied insert statements and verify that proper data has been saved in categories table in categories.sqlite file.

Also, if there are category icons attached then add category icons in drawable-* directories under path <android app source/trunk folder>/app/src/main/res/ and edit categories.sqlite depending upon icon required i.e. use image_name field in categories table to set icons name.

After setting categories, we will change applicationId in build gradle under path <android app source/trunk folder>/app/ and to do this, just reverse your website domain and add "com.<sitewebsite>.android" as applicationId.

Now, change can_set_dummy_location to false in /app/src/main/res/values/variables.xml file.

Also, update appicon in <android app source/trunk folder>/app/src/main/res/mipmap-* directories.

Next, change Facebook app id in AndroidManifest.xml and <android app source/trunk folder>/app/src/main/res/values/strings.xml file.

At last, For compiling and generating application, start android studio and open project using "Import project (Eclipse ADT, Gradle, etc.)" option. If any dependency is missing then fix it and prepare/generate apk and test it before distribution.