Android Question Cant create PDF with Android 10 - Error

hasexxl1988

Active Member
Licensed User
Longtime User
Hello,

i have tryd to create a PDF Document with the Example: https://www.b4x.com/android/forum/threads/create-pdf-with-b4a-and-php.40863/#post-244779

i have copied the Source Code to new example App.

The Error at Start:

B4X:
Logger verbunden mit:  HUAWEI ELE-L29
--------- beginning of system
--------- beginning of main
Service started in the background. Trying to start again in foreground mode.
*** Service (starter) Create ***
** Service (starter) Start **
Service started in foreground mode.
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
** Service (starter) Destroy (ignored)**
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
[{"action":"init","grid":5,"showfooter":true,"charset":"ISO-8859-3"},{"action":"SetAuthor","author":"Manfred Ssykor"},{"action":"SetCreator","creator":"b4a-php-pdf"},{"action":"SetTitle","title":"Title bla bla bla"},{"action":"SetSubject","subject":"Subject bla bla bla"},{"action":"SetKeywords","keywords":"Keywords bla "},{"action":"NewPage"},{"action":"SetFont","font":"courier","style":"","size":12},{"action":"SetFont","font":"DejaVu","style":"","size":12},{"action":"settext","text":"Примерен доставчик ООД","border":"LBRT","x":140,"y":10,"w":72,"h":10,"r":255,"g":0,"b":0,"align":"C"},{"action":"SetText","text":" ","border":"LBR","x":5,"y":5,"w":72,"h":5,"r":64,"g":64,"b":64,"align":"L"},{"action":"setfont","font":"courier","style":"","size":14},{"action":"settext","text":"this is a test","border":"","x":5,"y":10,"w":72,"h":5,"r":255,"g":0,"b":0,"align":"C"},{"action":"settext","text":"Hello world","border":"B","x":5,"y":25,"w":72,"h":5,"r":0,"g":255,"b":0,"align":"L"},{"action":"SetText","text":"Hellooooo :-)","border":"","x":5,"y":50,"w":72,"h":5,"r":0,"g":0,"b":255,"align":"L"},{"action":"SetDrawColor","r":128,"g":128,"b":128},{"action":"line","x1":5,"y1":50,"x2":72,"y2":5},{"action":"SetfillColor","r":128,"g":0,"b":128},{"action":"rect","x":5,"y":75,"w":25,"h":25,"style":"DF"},{"action":"SetImage","imgurl":"http:\/\/chart.googleapis.com\/chart?cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World","x":40,"y":80,"w":180,"h":75,"type":"png"},{"action":"SetLinewidth","w":1.5},{"action":"SetImage","imgurl":"http:\/\/pdf.basic4android.de\/b4arulez.gif","x":5,"y":160,"w":75,"h":75,"type":"gif"},{"action":"SetDrawColor","r":128,"g":0,"b":128},{"action":"line","x1":48,"y1":180,"x2":70,"y2":175},{"action":"setfont","font":"courier","style":"BI","size":16},{"action":"settext","text":"Erel rulez!","border":"0","x":75,"y":170,"w":25,"h":5,"r":255,"g":0,"b":0,"align":"L"},{"action":"SetImage","imgurl":"http:\/\/pdf.basic4android.de\/icon.png","x":125,"y":180,"w":72,"h":72,"type":"png"}]
Error occurred on line: 129 (Main)
java.lang.SecurityException: getUniqueDeviceId: The user 10175 does not meet the requirements to access device identifiers.
    at android.os.Parcel.createException(Parcel.java:2071)
    at android.os.Parcel.readException(Parcel.java:2039)
    at android.os.Parcel.readException(Parcel.java:1987)
    at com.android.internal.telephony.IHwTelephony$Stub$Proxy.getUniqueDeviceId(IHwTelephony.java:3156)
    at android.telephony.HwTelephonyManagerInner.getUniqueDeviceId(HwTelephonyManagerInner.java:1251)
    at android.telephony.HwInnerTelephonyManagerImpl.getUniqueDeviceId(HwInnerTelephonyManagerImpl.java:358)
    at android.telephony.TelephonyManager.getDeviceId(TelephonyManager.java:1653)
    at anywheresoftware.b4a.phone.Phone$PhoneId.GetDeviceId(Phone.java:441)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:197)
    at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:262)
    at b4a.example.main._createpdf(main.java:457)
    at b4a.example.main._imageview1_click(main.java:584)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:197)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
    at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
    at android.view.View.performClick(View.java:7213)
    at android.view.View.performClickInternal(View.java:7187)
    at android.view.View.access$3500(View.java:828)
    at android.view.View$PerformClick.run(View.java:27675)
    at android.os.Handler.handleCallback(Handler.java:900)
    at android.os.Handler.dispatchMessage(Handler.java:103)
    at android.os.Looper.loop(Looper.java:219)
    at android.app.ActivityThread.main(ActivityThread.java:8347)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055)
 
Top