Wish Android Wear Library

postasat

Active Member
Licensed User
Longtime User
Hi all,
I need/wish an android library to send and receive simple text string from phone to watch and from watch to phone.
I know that Barx made a good "Wearable DataLayer Library" but is not possible to use with latest Play Services.
I hope in community and in Erel.
Thank you everybody !
 

DonManfred

Expert
Licensed User
Longtime User
I know that Barx made a good "Wearable DataLayer Library" but is not possible to use with latest Play Services.
Why not? Using B4A 6 i guess you should just change the requirement for the old android-support-v4-jar with the new classname in the maven-repo

Post your project / error if you run into errors.
The complete errormessage may help
 

postasat

Active Member
Licensed User
Longtime User
I'm using the dynamic example from Barx:
https://www.b4x.com/android/forum/threads/wearable-datalayer.49968/#post-311888

I modified for the last google play services adding the following line
B4X:
#AdditionalJar: com.google.android.gms:play-services-location

and deleting the previous:
B4X:
#AdditionalRes: C:\Program Files\adt-bundle\adt-bundle-windows-x86_64-20130729\sdk\extras\google\google_play_services\libproject\google-play-services_lib\res, com.google.android.gms

When I compile the "wearable" app of the example I have the following error:

Compiling generated Java code. Error
B4A line: 34
DL.Initialize(\
javac 1.8.0_60
src\barxdroid\wearable\example\dynamicmessage\main.java:334: error: cannot access DataApi
mostCurrent._dl.Initialize(processBA,"DL");
^
class file for com.google.android.gms.wearable.DataApi not found
1 error

the line 34 in the wearable example is the following:
B4X:
DL.Initialize("DL")
and in the globals DL is:
B4X:
Dim DL As WearableDataLayer

This error happen in the "mobile" version of the example code for the same reason.

I think it must be updated the library but I'm not sure.

Thanks,
Roberto.
 

postasat

Active Member
Licensed User
Longtime User
With your help, now I can compile wearable and mobile app.
I updated jdk to 1.8.0_102.
After install the mobile version on phone, just when it opens, crash immediately with the following error:

** Activity (main) Pause, UserClosed = false **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
java.lang.IncompatibleClassChangeError: The method 'void com.google.android.gms.common.api.GoogleApiClient.connect()' was expected to be of type interface but instead was found to be of type virtual (declaration of 'barxdroid.wearabledatalayer.WearableDataLayer' appears in /data/app/barxdroid.wearable.example.dynamicmessage-1/base.apk)
at barxdroid.wearabledatalayer.WearableDataLayer.Connect(WearableDataLayer.java:94)
at barxdroid.wearable.example.dynamicmessage.main._activity_resume(main.java:404)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:703)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:337)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
at barxdroid.wearable.example.dynamicmessage.main.afterFirstLayout(main.java:108)
at barxdroid.wearable.example.dynamicmessage.main.access$000(main.java:17)
at barxdroid.wearable.example.dynamicmessage.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5728)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
 

tpakis

Active Member
Licensed User
Longtime User
Top