B4A Library AppUpdating - automate apps updating from a webserver

Status
Not open for further replies.

udg

Expert
Licensed User
Thank you. I did include a few suggestions from the thread for the final release of AppUpdating 1. It's ready since a few weeks but I'd like to briefly test it before submitting to post#1.
Hopefully I'll have some spare time before Xmas.
 

victormedranop

Well-Known Member
Licensed User
trying everything in android 7. but no luck
this is the error

java.lang.NoSuchMethodError: No static method onStartCommand(Lanywheresoftware/b4a/BA;)Z in class Lanywheresoftware/b4a/objects/ServiceHelper$StarterHelper; or its super classes (declaration of 'anywheresoftware.b4a.objects.ServiceHelper$StarterHelper' appears in /data/app/b4a.example.appupdate-2/base.apk)

but work in amazon fire.
 

udg

Expert
Licensed User
Last edited:

techknight

Well-Known Member
Licensed User
Just a heads up my Pixel is running 8.1, and AppUpdating is still working fine, although I have recompiled it recently.
 
  • Like
Reactions: udg

Walter Scafati

Member
Licensed User
Hi,
I realized a App and I would to use this library for to implement the AutoApdate of the my App from the server.
Just I add the library AppUpdating v.1.30 I have the conflict with the OKHttpUtils2 v.2.61, and have the error. If I trie to remove the check from OKHttpUtils2 library I have'nt the error but the App crash when my this trying to connect to mySql DB on my server.
How I can solve this problem? Thanks.


Conversione byte code - ottimizzazione dex. Error
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/AsyncTimeout;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/AsyncTimeout$1;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/AsyncTimeout$2;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/AsyncTimeout$Watchdog;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/Base64;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/Buffer;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/Buffer$1;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/Buffer$2;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/BufferedSink;
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Translation has been interrupted
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:689)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:313)
at com.android.dx.command.dexer.Main.run(Main.java:279)
at com.android.dx.command.dexer.Main.main(Main.java:247)
at com.android.dx.command.Main.main(Main.java:106)
Caused by: java.lang.InterruptedException: Too many errors
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:681)
... 4 more
 

udg

Expert
Licensed User
Hi Walter,

did you read post #242 and those soon following it? You should recompile AutoUpdating from its source with your copy of B4A to overcome the differences on internal libraries' versions.

udg
 

Yayou49

Active Member
Licensed User
I'm happy to give you (with UDG authorisation) my updated class cl_appupdate (attached).
This version manage the new version of sdk (26)

It has been done with a part of Erel's code about Fileprovider.
I've tested it with my phone (Android 7.0 SdkVersion 24) and it works fine !

So:

1: add to your manifest
B4X:
AddManifestText(<uses-permission
    android:name="android.permission.WRITE_EXTERNAL_STORAGE"
    android:maxSdkVersion="18" />
)

AddApplicationText(
  <provider
  android:name="android.support.v4.content.FileProvider"
  android:authorities="$PACKAGE$.provider"
  android:exported="false"
  android:grantUriPermissions="true">
  <meta-data
  android:name="android.support.FILE_PROVIDER_PATHS"
  android:resource="@xml/provider_paths"/>
  </provider>
)
CreateResource(xml, provider_paths,
   <external-files-path name="name" path="" />
)
AddPermission(android.permission.REQUEST_INSTALL_PACKAGES)
2: Add in your starter class:

B4X:
Sub Process_Globals
    Public rp As RuntimePermissions
    Public SharedFolder As String  
End Sub

Sub Service_Create
    SharedFolder = rp.GetSafeDirDefaultExternal("")
End Sub
3: update the cl_appudate


Thanks to UDG for his time.
 

Attachments

Drago Bratko

Member
Licensed User
Is there a way to make app update in 'silent' mode ... so without asking user, and that app is updated and restarted ?
If not with 'normal' phone, is it possible wit rooted ones ?


Maybe this question was already asked and answered ... but I can't found it ...
 

udg

Expert
Licensed User
Unfortunately Android doesn't allow it, at least for non-rooted devices. I don't know if it can be done on rooted ones. Sorry.
 

DonManfred

Expert
Licensed User

cledic

Member
Licensed User
Hello to all,
I receive this error:
B4X:
copy fichier
android.system.ErrnoExceptionpen failed EROFS (Read-only file system)
using code from post: #243, plus suggested modification as from post: #290
I receive the error on App installed on: Android 5.0.1, Android 6.0 and Android 8.0.
The "Manifest" of my App is:
B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: http://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="26"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.
AddPermission(android.permission.ACCESS_COARSE_LOCATION)
'********* TabStrip ***********************
CreateResource(drawable, background_tab.xml,
<selector xmlns:android="http://schemas.android.com/apk/res/android"
   android:exitFadeDuration="@android:integer/config_shortAnimTime">
  <item android:state_pressed="true" android:drawable="@color/background_tab_pressed" />
  <item android:state_focused="true" android:drawable="@color/background_tab_pressed"/>
  <item android:drawable="@color/background_tab"/>
</selector>)
CreateResource(values, colors.xml,
<resources>
  <color name="background_tab_pressed">#50D3F180</color>
  <color name="background_tab">#50E4E4E4</color>
</resources>)
'******************************************
AddManifestText(<uses-permission
    android:name="android.permission.WRITE_EXTERNAL_STORAGE"
    android:maxSdkVersion="18" />
)
AddApplicationText(
  <provider
  android:name="android.support.v4.content.FileProvider"
  android:authorities="$PACKAGE$.provider"
  android:exported="false"
  android:grantUriPermissions="true">
  <meta-data
  android:name="android.support.FILE_PROVIDER_PATHS"
  android:resource="@xml/provider_paths"/>
  </provider>
)
CreateResource(xml, provider_paths,
   <external-files-path name="name" path="" />
)
AddPermission(android.permission.REQUEST_INSTALL_PACKAGES)

Android JAR is: C:\Android\platforms\android-26\android.jar
B4A ver is: 7.8

Can someone help me where am'I wrong?

Thanks
Clemente
 

techknight

Well-Known Member
Licensed User
Ran into a new problem with this lib.

For some weird reason the lib is hanging and not firing the UpdateComplete when ---- AppUpdating.ReadCurVN is called.

Only on one particular app. I checked everything else. Odd...

Edit: I actually traced it down to this not working:

B4X:
CallSub(Callback,Event&"_UpdateComplete")
So I think its a bug in B4A.
 
Last edited:

techknight

Well-Known Member
Licensed User
Turning off log filtering in logcat, I get this:

---- AppUpdating.ReadCurVN
Current Version: 1.30
sendKeyguardVisibilityChanged(true)
ignoring event: update_updatecomplete

Yikes! thoughts?

Recompiling with CallSubDelayed did not work either.

Edit: Nevermind. I was doing my update check in the Activity_create thread which will never work.

I have to release that thread and then use a timer or something, and that worked.
 
Status
Not open for further replies.
Top