Android Question Code sample request

eds1234

Member
Licensed User
Im new user of B4A, still on trial. Would like to have a working sample of Geocoder / MQTT / FTP, so I can do testing first. Hope you could help me.

Thanks
 
Last edited by a moderator:

eds1234

Member
Licensed User
Hi Erel,

Thanks for your response. I tried the Chat sample for MQTT, but upon opening, there is erro missing jMqttBroker error. I have the jMqttBroker2 lib.
When I checked it in the Library Manager, compiling has some error and compiling aborted.

Also, is there a working sample for ftp? like Chat for mqtt. sorry to ask like this. Thanks
 
Upvote 0

eds1234

Member
Licensed User
Hi Erel,

Chat sample compiled ok with jmqttbroker (moqueutte). My phone is connected via B4A-Bridge, when I hit F5, and it tried installing on phone, there is an error "App not installed."

what could the issue.

The basic sample was installed in my phone earlier.
 
Upvote 0

eds1234

Member
Licensed User
The chat example is now running, on my 2 phones. but when i click connect, (both server and client), the application crashes. what could be the issue?

Thanks
 
Upvote 0

josejad

Expert
Licensed User
Longtime User
the application crashes. what could be the issue?
To get a proper answer, you need to give us more data.
What is the log error? Without that information, we can't give you an answer.
Be sure when you get an error, of searching for it in the forum, most of times there's answer to another user.
 
Upvote 0

eds1234

Member
Licensed User
Hi. Here is the error log when i tried the Chat sample for mqtt:

B4X:
Error occurred on line: 40 (Starter)
java.lang.reflect.InvocationTargetException
   at java.lang.reflect.Method.invoke(Native Method)
   at anywheresoftware.b4a.keywords.Common.CallSubDebug3(Common.java:1061)
   at b4a.example.main._btnconnect_click(main.java:470)
   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:180)
   at anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
   at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
   at android.view.View.performClick(View.java:5698)
   at android.widget.TextView.performClick(TextView.java:10908)
   at android.view.View$PerformClick.run(View.java:22565)
   at android.os.Handler.handleCallback(Handler.java:739)
   at android.os.Handler.dispatchMessage(Handler.java:95)
   at android.os.Looper.loop(Looper.java:158)
   at android.app.ActivityThread.main(ActivityThread.java:7231)
   at java.lang.reflect.Method.invoke(Native Method)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
   at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:336)
   at anywheresoftware.b4a.debug.Debug.CallSubNew3(Debug.java:288)
   ... 22 more
Caused by: java.lang.reflect.InvocationTargetException
   at java.lang.reflect.Method.invoke(Native Method)
   at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:318)
   ... 23 more
Caused by: java.lang.ExceptionInInitializerError
   at anywheresoftware.b4j.objects.MqttAsyncClientWrapper.Initialize(MqttAsyncClientWrapper.java:42)
   at b4a.example.starter._connectto(starter.java:180)
   ... 25 more
Caused by: java.util.MissingResourceException: Can't find resource for bundle 'org.eclipse.paho.client.mqttv3.internal.nls.logcat_en_PH', key ''
   at java.util.ResourceBundle.missingResourceException(ResourceBundle.java:238)
   at java.util.ResourceBundle.getBundle(ResourceBundle.java:230)
   at java.util.ResourceBundle.getBundle(ResourceBundle.java:139)
   at org.eclipse.paho.client.mqttv3.logging.LoggerFactory.getLogger(LoggerFactory.java:73)
   at org.eclipse.paho.client.mqttv3.MqttAsyncClient.<clinit>(MqttAsyncClient.java:79)
   ... 27 more


line 40 is:
B4X:
client.Initialize("client", $"tcp://${Host}:${port}"$, "android" & Rnd(1, 10000000))

im getting both error on client and server, after i click Connect button, and the application in the phone will crash.

what could be the issue. same response on my samsung J5 and J6+ Thanks
 
Upvote 0
Top