How to move the platforms\android\assets\www directory into server-side?


#1

Hi, all,
Can i move the myProject\platforms\android\assets\www directory from client-side(APK in android OS phone) into the server-side(remote web server), so that needn’t upgrade the APK when modify some html or css or js file?
And how to prevent copy platforms\android\assets\www directory into platforms\android\build\intermediates\assets\www in APK build progress?


#2

I never tried that with the Ionic Framework, but I know it can be done with jQuery Mobile. So I think it should work. But this application will be rejected in Apple App Store and there a good chance Google will also reject it.

You will also lose every benefit of native application. So forget about Cordova plugins.


#3

Thanks @Gajotres.

If move the myProject\platforms\android\assets\www directory to server-side(remote web server),
the pros:
1. Don’t need frequently upgrade and install new APK into mobilephone when modify some html or css or js files, these files can download from server-side into mobile phone when needed and effect like the native app. So I think will not lose the benifit of native application.

the cons:
1. Apple App Store will reject the application. But why?

I have tried to delete the following code from myProject\platforms\android\build.gradle file:
// assets.srcDirs = [‘assets’]
and delete the following code from myProject\platforms\android\cordovaLib\build.gradle file:
// assets.srcDirs = [‘assets’]
then execute “ionic build android” command, the assets\www directory will not included in APK file.


#4

Why? Because you will essentially have a web page inside a native mobile app. It will in NO way improve user experience plus it will violate several Apple Store rules.

And you will lose every benefit. It will just be a glorified web application. Application will not be able to access any smartphone feature, there’s simply no point in this approach.