I am devloping one app which will restart after phone reboot for that I used Phoenix Third party library it is working upto Android pie version but for higher version it is not working.
Below is a code for that.
Build.gradle
implementation 'com.jakewharton:process-phoenix:2.0.0'
GlobalTool.Java
public static void restartApplication(Context context) {
Log.d("IN App restart:", "");
ProcessPhoenix.triggerRebirth(context);
}
Related
We had a Android app that had work fine with IBM Mobile Foudation Platform 8.0' AppAuthenticity. So we had to split the app into multiple android modules, and AppAuthenticity has not work since.
When trying to login with AppAuthenticity enabled there is no response, ie the success or error callbacks are never fired.
https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/authentication-and-security/application-authenticity/
IBM MFP Server Version: 8.0.2019022810.
IBM MFP Android SDK Version: 8.0.+
Gradle build tool : 3.1.1
Gradle 4.4
The problem happens with debug and release apks.
Log.d("TAG", "loginMobileFirst init"); // This appears in logcat
String securityCheckName = CaixaSecurityCheckChallengeHandler.SECURITY_CHECK_NAME;
WLAuthorizationManager.getInstance()
.login(securityCheckName, this.getCredencial(),
new WLLoginResponseListener() {
#Override
public void onSuccess() {
Log.d(TAG, "loginMobileFirst Success"); // This never appears in logcat
setLogged(true);
callBack.onSuccess(null);
}
#Override
public void onFailure(WLFailResponse wlFailResponse) {
Log.d(TAG, "loginMobileFirst Failure"); // This never appears in logcat
Log.d(TAG, "Erro no login: " + wlFailResponse.getErrorMsg());
callBack.onError(context.getString(R.string.api_error_sistema_indisponivel));
}
});
}
MobileFirst does not yet support app modules of Android. Please create a single apk for your app until this is supported.
Please open a request for enhancement at https://www.ibm.com/developerworks/rfe/execute?use_case=changeRequestLanding&BRAND_ID=0&PROD_ID=702&x=17&y=6
The problem was solved deleting the directory app/src/main/jniLibs. I believe that directory was included in a old version of IBM MFP (7.1)
Thank you, Folks!
I developed an application that uses DJI SDK. When installed as an system application it crashes on Launch because its not able to load the libraries. It works fine when installed as normal application.
Steps followed to make system application
1)Rooted the device
2)Copied the .apk file to system/app directory
3)Rebooted the device
4)App was installed as default application but crashed on Launch
After commenting out the following line related to DJI SDK and followed the same steps as above. It worked fine as system app.
Helper.install(context);
The implementation of Helper class which is in DJI SDK is as below:
public static void install(Application app) {
Object var1 = null;
try {
System.loadLibrary("DexHelper_sdk");
if (PPATH != null) {
System.load(PPATH);
}
} catch (Error var3) {
;
}
String app_dataDir = app.getApplicationInfo().dataDir;
DexInstall.install(app, new File(app_dataDir + "/.cache_sdk/sdkclasses.jar"));
}
As far as my understanding the crash is because the system is failing to load the libraries.
My gradle looks similar as in the following link:
https://github.com/dji-sdk/Mobile-SDK-Android/blob/master/Sample%20Code/app/build.gradle
this issue has been fixed since 4.6 version of Android MSDK, pls try to update to the later version, right now the 4.7.1 has been released.
Device: Android
Target Version: 25
Cordova version: 7.0.1
I'm using cordova-plugin-geolocation https://www.npmjs.com/package/cordova-plugin-geolocation but with some devices doesn't work. I tried the application
with these devices:
Huawei P9 Lite VNS-L31 Android 7.0 ---> work
Huawei P9 Lite VNS-L21 Android 7.0---> work only if i disallow the battery optimization of the application.
Huawei P9 Android 7.0--> doesn't work
One Plus 3 Android 7.1.1 --> work
Samsung S8 Android 7.0 --> work
CODE:
navigator.geolocation.getCurrentPosition(onSuccessPoint, onErrorPoint,{ timeout:10000 });
var onSuccessPoint = function (position) {
///SUCCESS CODE
}
function onErrorPoint(error) {
//ERROR CODE
}
You app must run in background mode , if your app not white listed under battery optimization your app won't run. use this cordova plugin to white list your app from battery optimization,
Install
cordova plugin add https://github.com/thomas550i/cordova-plugin-doze-Optimize
Javascript code
cordova.plugins.DozeOptimize.IsIgnoringBatteryOptimizations(function (responce){
console.log("IsIgnoringBatteryOptimizations: "+responce);
if(responce=="false")
{
cordova.plugins.DozeOptimize.RequestOptimizations(function (responce){
console.log(responce);
}, function (error){
console.error("BatteryOptimizations Request Error"+error);
});
}
else
{
console.log("Application already Ignoring Battery Optimizations");
}
}, function (error){
console.error("IsIgnoringBatteryOptimizations Error"+error);
});
I wish to use this native plugin for Android devices via Unity.
For some reason the plugin is just now working. When I run it on a real device the game crashes. I am using Unity 5.5.2f1 personal, my phone is Samsung Edge 6 with Marshmallow api.
I have placed the jar file inside Assest/Plugins/Android. I can't figure out what is the cause for this error. Do you know what is wrong here?
This is part of my code:
private AndroidJavaObject plugin;
void Start ()
{
plugin = new AndroidJavaClass("jp.kshoji.unity.sensor.UnitySensorPlugin").CallStatic<AndroidJavaObject>("getInstance");
//Init the ambienttemperature sensor
if (plugin != null)
{
plugin.Call("startSensorListening", "ambienttemperature");
}
}
I am updating the app I am working on to work on Android 6.0.
In the beginning the app would crash, but updating the gradle file to use the newest versions of external libs (intercom and GCM services) did the trick and the app runs smoothly.
The only problem is that on startup a Toast message is displayed with the text: "Please specify next permissions in your manifest file: android.permission.WRITE_EXTERNAL_STORAGE".
The permission is of course written in the manifest file.
I am assuming this has something to do with the runtime permissions mechanism that Android 6.0 introduces (the message doesn't appear when running with older version of Android).
Another annoying little issue is that the toast message doesn't appear when running with a debugger (using Android Studio 1.4).
How can I know what is causing this Toast to appear? Has anyone else encountered this problem?
Thank you!
I have experienced this issue in my project as well, and it turns out that the toast is from ubertesters SDK, I decompiled the jar file and this is what I found.
package com.ubertesters.sdk.utility;
public class StringProvider {
public StringProvider() {
}
public static String addPermission() {
return "Please specify next permissions in your manifest file: ";
}
public static String installLatestVersion() {
return "Please, install the latest Ubertesters Hub version.";
}
public static String install() {
return "Install";
}
}
I will suggest you to exclude ubertesters SDK in your release product flavour and you won't see this toast in the release build.
Ubertesters has not updated its Android SDK for more than a year ... http://ubertesters.com/knowledge-base/android-sdk/
Ubertesters is constantly updating SDK for Android. The issue with handling permissions on Android 6.0 is successfully fixed in the next SDK version.
Please feel free to check and user our latest SDK available on the website http://ubertesters.com/knowledge-base/android-sdk/