Main /
How to test an App in AndroidTo run your App in an Android device (even when you are not connected to the Internet), you need to do the following:
Before we begin, please download and install in your computer the Android Studio environment. This environment contains all the programming utilities required to create Android apps (even from scratch). Follow the instructions in this link. Android Studio is large (some 700 or 800 Mb), so be patient. 1. Build the IONIC code specific for the Android platform For this, type ionic cordova build android. This process can produce a number of errors if you did not install the Android Studio (as we told you to do!) It can also require that you install a number of additional packages. Just do it. When successful, the process will create a subfolder of your project folder platforms, called android. 2. Use Android Studio to compile this code for the Android platform Open Android Studio in your computer and choose the option Open an existing Android Studio project. Select the android folder as the 'existing Android Studio project'. (Android Studio may ask you to install some other things... accept.) This will open your project and automatically build it (compile it for Android). 3. Test on your Android device This requires a number of preliminary adjustments in your device (phone or tablet). But, once they are done, testing is as simple as connecting the device to your computer and running the Android Studio project, selecting your device as target. Here is the list of adjustments to make:
Your device is now ready. Connect it with a USB cable to your computer and in Android Studio click Run -> Run app. A dialog will show that your device is connected, selected it and click OK. The app should run in your device. In some cases (we've experienced this on a Windows system), the device is not recognised. In this case, you need to install a driver for your device. Visit this page for instructions and finding your driver.
4. Alternatively, generate a self-contained APK file On Android Studio, click on Build -> Build APK(s). This will generate a file ending in .apk. Open it from your device. (You can, for instance, put it in your Dropbox folder and open it from the device.) When you open it, Android recognises it is an app, and will issue a message asking if you want to install this application. Install it and that is all. 5. Eventually, put your app in the Google Play Store This is a standard procedure and is beyond the scope of these instructions. Here are some hints and llinks:
http://weelookang.blogspot.sg/2016/08/creating-single-apps-using-easy.html |