Making Android App using Drupalgap

For page specific messages
For page specific messages

This is step by step guide for making andriod app using drupalgap.

 

  1. Install drupalgap module. It requies some of other modules which you need to install.
  2. After enabling drupalgap module. click on "configuration" menu. On the page go to the "Web Services" and click on "drupalgap".
  3. From this page download drupalgap app.

Compling Downloaded app:-

  1. Install Node.js. Used yast to install Node.js.
  2. After installing above install Cordova. Use following command to install cordova.

npm install -g cordova

   3. Install Android SDK. Install Android 22.

  4. After installing SDK add tools and platform-tools of android SDK to the path variables. Below are the lines from my ".bashrc".

export JAVA_HOME=/usr/java/jdk1.8.0_60

export ANDROID_HOME=/home/aashutosh/android-sdk-linux

export PATH=${PATH}:.:$JAVA_HOME/bin:$ANDROID\_HOME:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

  5. Now, create a cordova project. As:-  cordova create ExampleApp com.example "ExampleApp"

  6. Change Directory to ExampleApp. As:-  cd ExampleApp

  7. Install required plugins like: cordova plugin add org.apache.cordova.console org.apache.cordova.device org.apache.cordova.dialogs org.apache.cordova.file org.apache.cordova.inappbrowser org.apache.cordova.network-information

cordova plugin add org.apache.cordova.camera org.apache.cordova.geolocation

 

  8. Install downloaded drupalgap app over cordova created project. It means that extract the content of the downloaded drupalgap app to the www directory of cordova created project. So, it overwrites many of the files the coming with cordova created projects.

 9. Go to the  ExampleApp/www directory and open the settings.js file. Change the value of "drupal.settings.mode" to phonegap. like below.

           drupalgap.settings.mode = 'phonegap';

10. Copy ExampleApp/platforms/android/platform_www/cordova.js to ExampleApp/www/cordova.js .

11. Apend following line in ExampleApp/www/index.html.

     <script type="text/javascript" rel="lightbox" src="cordova.js"></script>


Now, Go to your ExampleApp and run following command.
cordova platform add android
cordova build cordova run android (This command is needed when your are connected your android phone with your pc).
It will generate "android-debug.apk" in ExampleApp/platforms/android/build/outputs/apk
. This is your required android app.


Comments

These are the list and link for downloading required modules while installing "drupalgap":

drupalgap:- serveices, views_datasource

DrupalGap Entity Reference:- Entityreference

DrupalGap Flag:- Flag, Flag_service

DrupalGap Rate:- Rate, Services_votingapi

DrupalGap Static Map:-  Staticmap

DrupalGap User Registration Password:-  User_registrationpassword

DrupalGap Webform:-  Webform_service

Some of other modules required to install

Votingapi, Webform_submission_uuid