Self patch cordova application - android

I have a cordova application for android written in html/js/css. I install a generated apk on a customer tablet, assuming i allow installing apk without store.
I would like to deploy my application versions repo on the file system of my tomcat server.
Is it possible that when my android app starts, i check with a rest api if my app is up to date. If not, i download new apk from my tomcat server to the tablet, i launch apk installation, restart the app, delete download apk file, all that using cordova and plugins ...
Thank you very much for your response!

You can use the FileTransfer plugin to download the new apk and the FileOpener plugin to open and begin installing the update. The examples in those docs should give you what you need.

Related

How to build apk file that is upto date in IBM MobileFirst 8?

I have one basic question regarding MobileFirst 8.
In MobileFirst 7.1 we tend to build wlapp file and deploy it on server which provides soft updates to existing app user. If I build the apk file with same resources as of wlapp file, it won't take update as its resources are already upto date.
We don't have wlapp file in MobileFirst 8. We can deliver update through web update command. But how do I build apk or ipa file that contains latest resources and won't take any soft update.
Currently, I am building webupdate zip, upload it to MFP Server and then build apk, but then also it is asking for update. Is there any specific commands I have to execute?
In MobileFirst Foundation 8.0 you create and build the Cordova project using Cordova tools. To generate the .apk file, consult the Android and/or Cordova documentation.
MobileFirst Foundation comes to play only once you add the cordova-plug-mfp plug-in, which is the MobileFirst SDK for Cordova applications.
Also, as you mentioned, the concept of a .wlapp file is no more. There is no need (or way...) to deploy this file to the MobileFirst Server. Instead, you only register the application in the MobileFirst Server either via the MobileFirst Operations Console or the MobileFirst CLI.
Once you want to use the Direct Update feature, you can follow these steps:
Make changes in your application JavaScript/CSS/HTML
Propagate your changes to the native project in Cordova by using the cordova prepare command
Deploy the updated web resources to the MobileFirst Server by using the mfpdev app webupdate command
The next time the application will attempt to access a secured resource that is protected by the MobileFirst Server, the request to the server will also check for updated resources. If updated resources are found, these will be presented to the end user to update the application.
Once an update has taken place, the application will no longer check for updates for as long as the token the app received from the server is valid. The expiration value of the token is 60 minutes. So for the next 60 minutes the application will not be able to receive direct updates.
Throughout this process there is no need to re-build the .apk file and do anything with it. This is all about the web resources of the application.
You only need to build a new .apk file if you intend to submit a new application version to the Google Play Store.
Repeat this process for future direct updates.
Learn more about Direct Update, here: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/application-development/direct-update/

How to deploy & publish cordova ios from VS2015

I have develop an Cordova App in vs2015 and I'm able to deploy on android, test and publish on Play Store.
So, I attach my remote iMac and compile&build ios platform but I don't find a simple and robust path for deploy.
First of all, to deploy on App Store I need to do it only from iMac... is possible to deploy directly from Win10 after build from mac?
So if it's correct I need to open the .xproject and prepare to send to app store but the .xproject change on every new deploy from VS (the remote_build create a new folder on every build).
There is a very good resource for you to see how to "Package your Cordova app so that you can publish it to a store".
You can learn how to prepare them for Android, iOS and Windows App Store publish.
Here it is at this url: Package your Cordova app so that you can publish it to a store

Phonegap 5.4.1 icons and build issues

I am developing an app using phonegap 5.4.1, I found out that there is a overall new documentation for adobe phonegap. I have gone through that and I have created the app using CLI as per documentation see the link below http://docs.phonegap.com/getting-started/3-create-your-app/cli/ and it has been created successfully. While running the app I have installed "Phonegap Developer App" in my device and through this app I can run my app. Check below
http://docs.phonegap.com/getting-started/4-run-your-app/cli/
Now my enquiry is, how can I store my app in the device, as its not getting stored anywhere and if I need to send apks to other device how can I accomplish that. Need help. Thanks a lot in advance.
You need to create an apk with the CLI
cordova build android --release
This will create a debug version that can be run on developer unlocked phones.
You'll need to sign it if you intend to upload it to the Play Store: Here

Phonegap APK expansion with com.flyingsoftgames.xapkreader plugin

I'm having troubles with APK expansion management in a Phonegap application on Android platform.
I installed the com.flyingsoftgames.xapkreader phonegap plugin and following all the instructions I managed to upload the first APK along with its expansion .obb file.
The first download from the Play Store worked just fine: the app and its extras were successfully downloaded to the device with a single operation.
After publishing an update of the APK and downloading it to the device, the following happened:
I launched the updated application;
The downloader activity of the com.flyingsoftgames.xapkreader started, showing the download dialog;
Since the .obb file didn't change and a copy of it was already present in the local folder, the downloader activity read "Download completed.";
Finally the problem is that the dialog was not dismissed, nor it presents any way to dismiss it manually, so the application doesn't proceed with its launching.
The only way to launch it, is to kill it (in order to stop the "stuck" download activity) and opening it again.
Should I provide a different .obb for each updated version? I don't think so, since this would invalidate the APK+OBB mechanism, conceived to allow for smaller sized updates, as far as I have understood.
Thank you in advance for any advice.
Actually it seemed like a bad installation of the plugin.
I resolved by removing all plugins, rebulding the application for the desired platform from scratch (e.g. phonegap build android) and by re-installing all the plugins.
I noticed something strange though: the installation of the plugin via phonegap plugin installer (with command phonegap plugins add com.flyingsoftgames.xapkreader) installs a different version than the one from the github repository (with the command phonegap plugin add https://github.com/agamemnus/cordova-plugin-xapkreader.git).
So pay attention in case you find different instructions in tutorials and forums.
The version that worked for me was the one from the github repository.

Upgrade apk downloaded from own web server

I need help in upgrading apk file. I have apk file developed for android 2.2 and I donot wish to publish my apk on android market. I published apk in our own webserver. And i could download it to my android mobile. Now the issue is that how can i upgrade apk file by publishing in our webserver.
My questions are:
How android market does apk upgrading?
How to upgrade a binary in android mobile with new version of which old version is already installed?
I used android built in view using intent which actually Re-installs apk not upgrading.But i don't want prompts asking "Do u want to install application?".
I want the apk to be upgraded once user click upgrade button without showing prompt to user, like doing in android market.
Is there any method to upgrade apk in android?
Are there any restrictions doing that?
Are there any specific permissions i need or i need to set in manifest file.
Once you've downloaded the APK, Android itself decides if the program is installed and needs to be upgraded, or if it is a new installation. Users can decide for themselves whether to upgrade or not.
Besides how to find out when there is an update available, it's not possible to upgrade it without prompting the user with the "Do you want to install". Android doesn't allow third apps to install apps unless the phone is rooted and your app has root access, but I think that this isn't your target group.
I have no experience with that but what you could try is loading classes manually from your server and then store it in the assets folder.
http://android-developers.blogspot.com/2011/07/custom-class-loading-in-dalvik.html
This is one approach, I don't think that it's very handy and easy but it would work.
Hope it helps!
PS:
And just because I'm wondering, is there a reason why don't you wanna publish it on the Android Market?
When you are publishing an App on your private web server, you need to create a process through which you can check for new version .There is No in built method for doing this .
I have created one as well.

Categories

Resources