Wednesday, October 14, 2015

How to set number of suggestions to show with jQuery UI autocomplete

There is no native way to limit results in jQuery UI autocomplete widget. You have two options to achieve your target:
  1. You can limit returned results on the server side.
  2. You can modify results on client side by slicing results array:
$("#autocomplete_input").autocomplete({
    source: function(request, response) {
        var results = $.ui.autocomplete.filter(yourarray, request.term);
        response(results.slice(0, 15));
    }
});

Wednesday, February 25, 2015

Increase Import file size limit in PHPMyAdmin

You need to change the upload_max_filesize, post_max_size parameters in php.ini file, and then you need to restart your server.

Sunday, February 22, 2015

How to check / update cordova android version of a cordova/phonegap project?

The current platform version of a cordova app can be checked by the following command

cordova platform version android
And can be upgraded using the command

cordova platform update android
You can replace android by any of your platform choice like "ios" or some else.

Friday, February 20, 2015

How to Sign and Publish a Phonegap App in the Google Play Store

If you have Finished your Phonegap application and you want to submit it to Google Play Store then you should follow the following steps:

1. Register in Google Developer Console ( https://play.google.com/apps/publish/signup/ ) - $ 25.00
  • After you pay for membership, you will need to wait max 48h to Google finish the transaction, but until then you will be able to create new application, upload you .apk file etc..
2. You must upload the zipaligned .apk file to Play Store.
3. How to zipalign your .apk file with phonegap / cordova?
  • First you must create the myApp .keystore file.
  • Copy myapp.keystore to /platforms/android. Now it’s time to sign the app with the key and create the release version.
  • Open myApp/platforms/android/local.properties (or project.properties) in a text editor.
  • Add these two lines at the end and save, even though it says, “Do not modify this file — YOUR CHANGES WILL BE ERASED!”
  • key.store=myapp.keystore
    key.alias=myapp
4. Still in your /myApp folder in Terminal, run: cordova build android --release You’ll be asked for your password twice and it won’t be obfuscated.

5. Your myApp.apk file is put in /myApp/platforms/android/ant-build/CordovaApp-release.apk. This is the file you rename and upload to Google Play.

How to generate .keystore file?

The signing key is a small file which identifies the creator. It will get built into the .apk file so the developer who built the app can be identified. Since the information in the signing key is all supplied by the developer, it really doesn't provide any security. It will make sure that updates to an app are generated by the same user.

1. Install the Java Development Kit
2. Open a CMD or Terminal session

On Windows, open a cmd window and change directory to
cd c:\Program Files\Java\jdk1.7.0_25\bin


3. Use KeyTool to create the keystore file
Enter this command, replacing 'KitchenSink' with the name of your app.

keytool -genkey -v -keystore myApp.keystore -alias myApp -keyalg RSA -keysize 2048 -validity 10000

The file KitchenSink.keystore has now been created in c:\Program Files\Java\jdk1.7.0_25\bin. If you would like it created elsewhere, replace KitchenSink.keystore with the complete path. i.e.

Here are a few more good blogs which could help you: