Android Question Problems running DJI application

Discussion in 'Android Questions' started by Buks, May 24, 2018.

Tags:
  1. Buks

    Buks Member Licensed User

    I am trying to run the DroneFirst example which I downloaded from the DJI Drones page.

    I get the following error when the application starts:
    **************************** BaseApplication **************************
    *** Service (starter) Create ***
    ** Service (starter) Start **
    ** Activity (main) Create, isFirst = true **
    ** Activity (main) Resume **
    java.lang.SecurityException: getDeviceId: Neither user 10121 nor current process has android.permission.READ_PHONE_STATE.
    at android.os.Parcel.readException(Parcel.java:1693)
    at android.os.Parcel.readException(Parcel.java:1646)
    at com.android.internal.telephony.ITelephony$Stub$Proxy.getDeviceId(ITelephony.java:5139)
    at android.telephony.TelephonyManager.getDeviceId(TelephonyManager.java:914)
    at dji.internal.e.a.f(Unknown Source)
    at dji.internal.e.a.c(Unknown Source)
    at dji.internal.e.a.a(Unknown Source)
    at dji.internal.e.a$1.run(Unknown Source)
    ** Activity (main) Pause, UserClosed = true **
     
  2. DonManfred

    DonManfred Expert Licensed User

    Add Runtimepermissions to your app. Request this permission.
    The error is not related to DJI Library.
     
  3. MarkusR

    MarkusR Well-Known Member Licensed User

    i guess u must request this permission in the manifest file.
     
  4. Buks

    Buks Member Licensed User

    This is part of the Manifest file:

    '************ DJI SDK '************
    SetApplicationAttribute(android:name, "anywheresoftware.b4a.objects.BaseApplication")
    SetApplicationAttribute(android:largeHeap, "true")
    AddPermission(android.permission.BLUETOOTH)
    AddPermission(android.permission.BLUETOOTH_ADMIN)
    AddPermission(android.permission.VIBRATE)
    AddPermission(android.permission.INTERNET)
    AddPermission(android.permission.ACCESS_WIFI_STATE)
    AddPermission(android.permission.WAKE_LOCK)
    AddPermission(android.permission.ACCESS_COARSE_LOCATION)
    AddPermission(android.permission.ACCESS_NETWORK_STATE)
    AddPermission(android.permission.ACCESS_FINE_LOCATION)
    AddPermission(android.permission.CHANGE_WIFI_STATE)
    AddPermission(android.permission.MOUNT_UNMOUNT_FILESYSTEMS)
    AddPermission(android.permission.WRITE_EXTERNAL_STORAGE)
    AddPermission(android.permission.READ_EXTERNAL_STORAGE)
    AddPermission(android.permission.SYSTEM_ALERT_WINDOW)
    AddPermission(android.permission.READ_PHONE_STATE)
    AddManifestText(
     
  5. MarkusR

    MarkusR Well-Known Member Licensed User

    in newer android os its possible to overwrite this permissions and the app did not get this.
    hmm, try this Runtimepermissions that Manfred mentioned.
     
    Last edited: May 24, 2018
  6. Erel

    Erel Administrator Staff Member Licensed User

    Quoting the tutorial:

    Two examples are attached:
    DroneFirst - A basic example for generic flights.
    DroneMission - Example of using WaypointMissionOperator to create a waypoint mission.
    The DroneMission demonstrates how to request the permissions when setting targetSdkVersion to 26.

     
  7. Buks

    Buks Member Licensed User

    Thank you very much. I managed to solve the permissions issue.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice