Android
33 posts · All topics
Android Transition Examples
A sample project showing the Android transition framework: scenes, built-in animations and transitions defined in XML.
Integrate a Native Library into an Android Gradle Project — Sample Project
Step-by-step setup for building and loading an NDK native library in an Android Studio Gradle project, with a sample project.
Generate the Cordova JAR File from a PhoneGap Project Using Ant
Build cordova.jar from the CordovaLib project with Ant, so you can use Cordova as a library in Android Studio.
Update the Android Main UI from a WebView — PhoneGap Plugin
A simple PhoneGap plugin that lets JavaScript in a WebView update the native Android UI, such as the action bar.
Get Recent Callers — Android PhoneGap Plugin
A simple PhoneGap plugin that fetches recent callers from an Android phone, with setup steps.
PhoneGap Android — Contact Image Problem with Android 4.4
Android 4.4 KitKat won't display contact photo URIs in a WebView. A workaround that reads the image natively and returns it as Base64.
jPlayer Not Working in the HTC One Android 4.3 Browser
A workaround for jPlayer's media load bug on some Android browsers: add a short delay before calling media.load().
Methods Called from a WebView Need the @JavascriptInterface Annotation — Android Development
Since Android 4.2, native methods called from JavaScript in a WebView must be annotated with @JavascriptInterface.
Useful ADB (Android Debug Bridge) Commands
A quick reference for common adb commands: install and uninstall apps, filter logs by tag and broadcast an install referrer.
RSA Public Key Encryption in an Android App with Server-Side Decryption in PHP
Encrypt data in an Android app with an RSA public key (Bouncy Castle) and decrypt it on a PHP server with phpseclib.
The Glass Computer — Google Glass
An introduction to Google Glass: its features, the technologies behind it, its hardware, and its pros and cons.
Eclipse Crashes When You Export an APK on a Mac — Solution
Eclipse kept crashing while exporting a signed APK on my Mac. Two steps that stop it happening.
Convert a Database Cursor to a JSON Array — Android App Development
Java code that converts an Android SQLite cursor into a JSON array, handy for PhoneGap plugins that run raw queries.
Useful Android Apps and Links for App Development
Handy apps and links for Android developers: AirDroid, AIDE, an HTML editor, a referral tester, sample projects and tutorials.
Get the Network Connection Name — Android App Development
Retrieve the name of the current network connection in Android, and call it from JavaScript in a PhoneGap app.
ADB Logcat Command to Filter by Tag Name — Android App
Filter Android logcat output by tag from the command line with adb logcat -s.
Social Share Plugin for Android Cordova 2.2.0 — Email, SMS, Facebook and Twitter
An updated version of my Android social share plugin that works with Cordova 2.2.0, with the new configuration steps.
Get Contacts with Images from an Android Phone and Sort Them by Name — Android PhoneGap App
Fetch contacts with their photos in an Android PhoneGap app, group them by first letter and sort them by name.
Get the Operator ID (MCC + MNC) from the SIM Card — Android App
Read the mobile operator ID (mobile country code plus mobile network code) from the SIM card in Java.
Get the Mobile Number from the SIM Card — Android App Development
How to read the mobile number (MSISDN) from a SIM card in Android, and why it isn't always available.
Using the Native Media Player with a Progress Bar — Android PhoneGap App
Play MP3 files with a progress bar in an Android PhoneGap app using the PhoneGap Media API.
Get the Device Model Name — Android App
A quick tip: retrieve the model name of an Android device from android.os.Build.
Steps to Convert a Web App into an Android PhoneGap App
The settings you need to turn a mobile web app into an Android PhoneGap app: whitelist, loading the URL, splash screen and error handling.
Handle the Back Button and Close the App — Android PhoneGap App
Close an Android PhoneGap app when the back button is pressed on the home page, and go back in history everywhere else.
Android PhoneGap Plugin for Social Sharing — Email, Facebook, Twitter and SMS
A PhoneGap plugin that opens Android's native share, email and SMS screens with predefined text, with setup steps.
Open Your App's Page in the Google Play Store App
Use a market:// link so your app's page opens directly in the Google Play Store app on Android phones.
Prevent Landscape Orientation in Android Apps
One line of code to lock an Android activity to portrait orientation.
How to Handle the URL Not Reached Error in Android PhoneGap
Stop an Android PhoneGap app from closing when the server or network is unavailable by handling onReceivedError and showing an offline page.
Check Network Connectivity Before Each App Action
Check network connectivity before every action in an Android PhoneGap app, using a native class exposed to JavaScript.
Open Links Inside the WebView — Android PhoneGap Configuration
Links in my Android PhoneGap app kept opening in the browser instead of the WebView. The fix is one line in cordova.xml.
Clear the Application Cache in an Android PhoneGap App
Stop stale JavaScript files in an Android PhoneGap WebView by clearing the cache before loading your URL.
jQuery Slider for iPhone and Android with the jQuery Cycle and Swipe Plugins
Add touch swipe support to a jQuery Cycle slider for iPhone and Android, with a small tweak to the jQuery Swipe plugin.
jPlayer Workaround for Android
jPlayer doesn't work properly on some Android phones unless you set solution: "flash,html" in its options.