LAMW jTelephonyManager problem [SOLVED] lazarus / 43-Android ---------------------------------------------------------------------- Segator · 2020-12-19 21:09 why jTelephonyManager not work any more in Android KitKat?, when you just put the componet in the form and build the app crash in Android KitKat. ---------------------------------------------------------------------- jmpessoa · 2020-12-21 20:41 Here, I tested the demo "AppTelephonyManagerDemo1"  and it is working:   Android 4.3,  Android 5.01 and  Android 6.01 ---------------------------------------------------------------------- Segator · 2020-12-21 21:31 try it on a AppCompact proyect, maybe is some new androidx incompatibility. ---------------------------------------------------------------------- jmpessoa · 2020-12-22 03:26 there is a minor fix in "App.java"   [support folder...] Code: Java  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   @Override    public void onActivityResult(int requestCode, int resultCode, Intent data) {          super.onActivityResult(requestCode, resultCode, data);  // <<----- new code !!!      controls.jAppOnActivityResult(requestCode,resultCode,data);     }  Can you test  again? ---------------------------------------------------------------------- Segator · 2020-12-22 21:09 Thanks Jose, I make some test, my app continued crash when i just add the componet with out add any code related to the componet, but in a new empty project with appcompact it work fine on android 4+, so maybe is some other components conflict with jTelephonyManager, i continue make tests because i can't use jTelephonyManager in my app. ---------------------------------------------------------------------- jmpessoa · 2020-12-22 21:17 Can you get some android "ADB"  log? Go to lazarus IDE menu:  "Tools" ---> "[LAMW]....."  -->  "ADB Logcat" ---> "....[dump]" PS. What about some "permission"  need  " jTelephonyManager" ? (You can see them in app demo code ....) ---------------------------------------------------------------------- Segator · 2020-12-22 21:38 Ok am go to dump the log by adb, the permission are ok because actually change the call method via IntentManager and work good the calling, but with this i can't approach the jTelephonyManager functions. ---------------------------------------------------------------------- Segator · 2020-12-22 22:13 Here is the dump, i note some lines: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i W/ActivityManager(  372): No content provider found for permission revoke: file:///data/local/tmp/databubble-appcompact- armeabi-v7a-debug.apk W/ActivityManager(  372): No content provider found for permission revoke: file:///data/local/tmp/databubble- appcompact-armeabi-v7a-debug.apk I/PackageManager(  372): Copying native libraries to /data/app-lib/vmdl1304943998 D/dalvikvm(  372): GC_CONCURRENT freed 663K, 23% free 6977K/8984K, paused 15ms+18ms, total 215ms D/dalvikvm(  372): WAIT_FOR_CONCURRENT_GC blocked 30ms D/dalvikvm(  372): GC_FOR_ALLOC freed 317K, 24% free 6845K/8984K, paused 85ms, total 85ms D/dalvikvm(  372): GC_FOR_ALLOC freed 242K, 24% free 6914K/8984K, paused 77ms, total 77ms D/dalvikvm(  372): GC_CONCURRENT freed 548K, 19% free 7306K/8984K, paused 9ms+11ms, total 112ms D/dalvikvm(  372): GC_CONCURRENT freed 974K, 19% free 7353K/8984K, paused 19ms+11ms, total 185ms D/dalvikvm(  372): GC_CONCURRENT freed 1081K, 18% free 7373K/8984K, paused 7ms+20ms, total 308ms D/dalvikvm(  372): GC_CONCURRENT freed 1086K, 18% free 7417K/8984K, paused 9ms+10ms, total 125ms D/dalvikvm(  372): GC_CONCURRENT freed 1115K, 18% free 7367K/8984K, paused 15ms+20ms, total 266ms D/dalvikvm(  372): GC_CONCURRENT freed 1041K, 18% free 7391K/8984K, paused 23ms+35ms, total 403ms I/ActivityManager(  372): Force stopping cu.segator.databubble appid=10069 user=-1: uninstall pkg i attached the manifest to because i think that this lines have relationship with it ---------------------------------------------------------------------- jmpessoa · 2020-12-22 22:34 googling i found this: https://stackoverflow.com/questions/11550798/android-no-content- provider-found-for-permission-revoke ---------------------------------------------------------------------- Segator · 2020-12-22 22:45 Finally found the problem, if you can see the Android manifest in the previous post it have the android.permission.CALL_PHONE and this is enough to make a call with the jTelephonyManager in Android 5+ but in KitKat the system log say me: java.lang.SecurityException: Neither user 10069 nor current process has android.permission.READ_PHONE_STATE, so i add it to the manifest and the app not crash any more, so you need the read phone state permission in Android 4.4.2 for jTelephonyManager too, this is not needed in modern android if you just make calls with the call phone permission is enough. ---------------------------------------------------------------------- jmpessoa · 2020-12-22 23:07 Nice! That's why the demo "AppTelephonyManagerDemo1"  works good!