Not able to launch a pdf file in inappbrowser in android

Unlike iOS, which has a built-in PDF viewer – Android’s webview does not have PDF viewer built-in. This is why it is going to fail in Android. You have 2 choices in Android: View the file using Google Docs by storing the file at a remote server and redirecting the user like so: window.open(encodeURI(‘https://docs.google.com/gview?embedded=true&url=http://www.your-server.com/files/your_file.pdf’), ‘_blank’, … Read more

Showing camera view inside html in android and then snap a picture

You can install mbppower/CordovaCameraPreview plugin (for android,ios) in your Cordova/phonegap application that allows camera interaction from HTML code. A really amazing plugin it is.. You can access Features such as: Start a camera preview from HTML code. Drag the preview box. Set camera color effect (Android and iOS),Send the preview box to back of the … Read more

Share something to a phonegap app

To appear in this list you have to modify the AndroidManifest.xml file and add the following lines under your activity : <intent-filter> <action android:name=”android.intent.action.SEND” /> <category android:name=”android.intent.category.DEFAULT” /> <data android:mimeType=”text/plain” /> </intent-filter> This will make your app appear in the list. Now I think you may probably also want to know how to handle this … Read more

How to handle Push notification when application is resumed?

I have faced the same issue. Simply put, PushPlugin does not support this feature now. But you can very easily modify it to suit your needs How it works now When a message is received by the plugin’s GCMIntentService, onMessage is called. This method fetches all the additional parameters passed to it, saving them in … Read more

Generating iOS and Android icons in Cordova / PhoneGap

I wrote a script that auto generates icons for cordova using ImageMagick: https://github.com/AlexDisler/cordova-icon To use it, create an “icon.png” file and place it in the root folder of your project, then run: cordova-icon and it will generate all the required icons for the platforms your project has. You can also configure it as a hook … Read more

Cordova InAppBrowser – How to disable URL and Navigation Bar?

To remove the URL, just set the ‘location‘ option to “no“. var ref = cordova.InAppBrowser.open(‘http://apache.org’, ‘_blank’, ‘location=no’); On Android, this removes the ‘Back/Forward’ buttons, URL and ‘Done’ button, not just the URL, but thankfully there’s a special Android-only ‘hideurlbar’ option to remove ONLY the URL. var ref = cordova.InAppBrowser.open(‘http://apache.org’, ‘_blank’, ‘hideurlbar=yes’); The ‘Done’ button text … Read more

Phonegap Plugin:How to convert Base64 String to a PNG image in Android

The solution; This plugin that converts a Base64 PNG String and generates an image to the sdCard. Let’s go! 1. The Base64 Decoder Get this blazing fast Base64 encode/decoder class called MiGBase64. Download it from SourceForge. Create a folder called ‘util’ within your project’s src/ folder. Place the downloaded class there. 2. The java Create … Read more