Ionic is a framework used for making hybrid applications, the best part is that you just write the code and you can have the apk and ios build.
The following are some points which you might find useful while making an ionic application.
Note:- The points made are from the personal experience while making an ionic app so they may not be appropriate.
– While publishing app always make a production build, this will give your app a big performance boost. While making a release build you might get some errors which you are not getting in release or any other build they are generally module related or plugin related which needs some credential information.
– I found that, if the page request data is been called from the page constructor then the data will respond quickly in comparison with any other lifecycle
events.
– Whenever you are taking data from api always make a promise request to your provider file because I found that if you will get the data from a normal method then sometimes you
will not get any response. The reason is simple because in ionic the request is asynchronous and it is not guaranteed that the response will come until you use promise or await.
– Things like real-time color change of app can be done with the help of real-time database of firebase.
Useful cli commands
The following are some useful cli commands that are used in ionic-
– For making all the resource file you just need one splash screen and one logo image and just run the following command all thr resource file of all resolutions will be created
1 |
ionic cordova resources |
– for making a production build
1 |
ionic cordova build android --prod --release |
– for making a release build
1 |
ionic cordova build --release android<code> |
Steps for Publishing Build
– Make a keystore file using cli
1 |
keytool -genkey -v -keystore my-release-key.keystore -alias kushagra -keyalg RSA -keysize 2048 -validity 10000 |
and provide all the information.
– Make the production build using cli
1 |
ionic cordova build android --prod release |
– Copy the build file and paste it to your java bin folder and run following command
1 |
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore android-release-unsigned.apk your-alias |
provide the alias name and password.
– Copy the generated apk file and paste it to your android folder and run the following cli
1 |
zipalign -v 4 android-release-unsigned.apk appname.apk |
and you will get a apk to publish on google play.
Recent Comments