15 Oct

Basic tips – Mobile application development with Ionic

BASIC TIPS FOR MOBILE APPLICATION DEVELOPMENT WITH IONIC FRAMEWORK

We sometimes get stuck up for small things while doing mobile applications. So here are few basic tips and solutions for Mobile application development with the Ionic framework:

These are some basic tips for Mobile application development with Ionic

1) Show status bar in Android phone

constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
platform.ready().then(() => {
// The platform is ready. So, here we can do any higher level native things you might need.
if(platform.is('android')) {
      statusBar.styleBlackOpaque();
}
else
{
      statusBar.styleDefault();
}
      splashScreen.hide();
});

2) Install multiple apps in the same Android phone for demo/testing.

<widget id="io.ionic.starter" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">

Change the widget version=”0.0.1″ like version=”0.1.1″. We can change widget id also. Then we will be able to install multiple apps in the same Android phone for demo/testing with different widget versions. So the output will be like:

<widget id="io.mycompany.starter" version="0.1.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">

3) Change the default icon and splash screen. [ add resource command ]

For the best result, we can use icon & splash screen PSD templates from Ionic.
https://code.ionicframework.com/resources/splash.psd
https://code.ionicframework.com/resources/icon.psd

Then we can save and replace those splash.png & icon.png images in the resource folder.
ionic Cordova resources command will re-generate images into all resolutions properly.

4) Getting unknown resource error while building release version with [jarsigner] command

Change android-release-unsigned.apk to android-unsigned.apk for jarsigner command and zip command. Ionic official doc is showing command with app-release-unsigned.apk That we have to update for our use.

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.jks app-release-unsigned.apk my-alias

Change code to

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.jks android-release-unsigned.apk my-alias


zipalign -v 4 app-release-unsigned.apk HelloWorld.apk

Change code to

zipalign -v 4 android-release-unsigned.apk HelloWorld.apk

Follow me

Sanju

I’m Sanjunath.S from Mumbai, India. I like web technologies, traveling & history. I have 9+ years experience in web technologies like HTML 5, CSS 3, JavaScript, Bootstrap and PHP.
Follow me

About Sanju

I’m Sanjunath.S from Mumbai, India. I like web technologies, traveling & history. I have 9+ years experience in web technologies like HTML 5, CSS 3, JavaScript, Bootstrap and PHP.




Pay with PayPal
Translate »