0

Till now my customer was using an old mobile with 4.4 android version. I didn't have any problems with my application. Since my customer has changed the mobile in a new Galaxy j5 (2017) with Android version 7.0 Nougat. After that, the application in the android throw black screens in random places and it kicks out my application with message application doesn't respond. I cant find where is the problem and why this happens. Should I change my 'target Android version' in Android 7.0? Till now I'm using 'Use Compile Using SDK version.' Or new mobile is defective?

Here is my XML File

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="WiOrderAndroid.WiOrderAndroid" android:versionCode="1" android:versionName="1.0" android:installLocation="auto">
    <uses-sdk android:minSdkVersion="16" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <application android:label="WiOrder" android:icon="@drawable/xs" android:theme="@style/CustomActionBarTheme"></application>
</manifest>
Dss
  • 3
  • 6
  • Examine the Android device log for causes: https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/android_debug_log/ – SushiHangover Nov 12 '17 at 21:22
  • The problem is that the application doesnt cause any problem in my emulator. After all it doesnt make always the problem.It may can work one day without problem and the other day make it always – Dss Nov 12 '17 at 21:27
  • Try using a crash reporting system to obtain more details: https://learn.microsoft.com/en-us/mobile-center/crashes/ – SushiHangover Nov 12 '17 at 21:43
  • "application doesnt responde" If this is ANR then it could be anywhere. – CmosBattery Nov 12 '17 at 21:51
  • What is anr? Also i have cath exeption everywhere.Can application ignore my exeprion and to get crash? – Dss Nov 12 '17 at 21:53
  • ANR is when the app takes too long and blocks UI thread. SEE: https://developer.android.com/topic/performance/vitals/anr.html – CmosBattery Nov 12 '17 at 21:54
  • no the problem is not anr. the application crashes and reopen again. Should i change anroid target version in nougat 7? or keep it to use compile using sdk version? – Dss Nov 12 '17 at 21:57
  • That's your call no one else's. – CmosBattery Nov 12 '17 at 21:58
  • How called this crash? with application doesnt respond? with black freeze screen for a while? – Dss Nov 12 '17 at 22:00

1 Answers1

0

If you only change version from 4.4 to 7.0 my guess will be a new runtime permissions. Since Android 6.0 you required to ask for dangerous permission at runtime. You can find the list of that permissions here:

List of Android permissions normal permissions and dangerous permissions in API 23?

From your manifests, I can see that you use 2 dangerous permissions, which required a runtime permissions (WRITE_EXTERNAL_STORAGE and READ_EXTERNAL_STORAGE).

Since you are using Xamarin, you can use that snippet to handle all requesting process:

https://github.com/jamesmontemagno/PermissionsPlugin/blob/master/src/Plugin.Permissions.Android/PermissionsImplementation.cs

Taier
  • 2,109
  • 12
  • 22
  • Ok i will try to remove read and write lines from my apk.Also i wiil make factory reset in the phone. Do you believe that is better to set minimum version and target version on android nougat 7? – Dss Nov 13 '17 at 06:57