fridgecow / smartalarm

Smart Alarm for Wear OS
GNU General Public License v3.0
37 stars 14 forks source link

apk request to try to get this working on full android smartwatches (amazfit pace) #8

Open caoHenriques opened 6 years ago

caoHenriques commented 6 years ago

Hi,

first of all, congratulations for this amazing project.

it is possible to sideload many standalone Wear OS apps for smartwatches running android some of them need the android wear framework, but then they work properly

I would like to try to get this working on my amazing pace, and if I'm succeed I will share with others, many people could benefit of your software.

could you please provide the apk? I cannot do it through the google play

thank you very much

caoHenriques commented 6 years ago

sorry my question was noob, the apk was in the realise folder.

I cannot install the app, it says INSTALL_FAILED_OLDER_SDK I guess your app was compiled for a newer version of android

The amazfit pace, and other Chinese smartwatches run android 5.1 do you think we could get your app running after compile the project for a older version of the android?

thank you

caoHenriques commented 6 years ago

so I figured out how to install,

I use apk easy tool to change the min sdk version down to 7 and target version to 24 I removed this line

I could install the app on my watch, but it crashed when start

Can you modify slightly the app in order to work in our watches?

I guess it will be simple, this is like a regular smartphone, with gyro and accelerometer, the difference is the screen size

other sleep track apps work here, but it is impossible to use them due to the small screen

cheers

fridgecow commented 6 years ago

I have actually previously looked into this - doing exactly the same as you, reducing the min SDK version for someone else.

The issue is that I am using the Google Wear SDK, which includes a set of libraries only available on Wear OS devices. It's possible to re-write the app without using these, but it's a bigger job than I'm willing to take on.

These libraries provide a lot of conveniences, such as UI elements designed specifically for watches, ambient display functionality, and the like.

caoHenriques commented 6 years ago

Hi,

thank you very much for the reply. will this method provide the libraries for your app to work on the amazfit? https://forum.xda-developers.com/smartwatch/amazfit/dev-android-wear-framework-t3781906

I tried it, but the app still crashes on startup, is there something I'm missing?

cheers

fridgecow commented 6 years ago

That's an interesting method, and probably gets most of the way to a working build (as far as I can tell).

Unfortunately, I don't know just from this what the issue could be - if you could access and post debug logs (you can get them from the Android Wear app, but I don't know about your watch...), that would be helpful.

On Jul 26, 2018, at 2:57 PM, caoHenriques notifications@github.com wrote:

Hi,

thank you very much for the reply. will this method provide the libraries for your app to work on the amazfit? https://forum.xda-developers.com/smartwatch/amazfit/dev-android-wear-framework-t3781906 https://forum.xda-developers.com/smartwatch/amazfit/dev-android-wear-framework-t3781906 I tried it, but the app still crashes on startup, is there something I'm missing?

cheers

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/fridgecow/smartalarm/issues/8#issuecomment-408106443, or mute the thread https://github.com/notifications/unsubscribe-auth/AHoPcLNwVdlk1H9uLaGkcnePIwBP_w7-ks5uKcrZgaJpZM4VVmuI.

caoHenriques commented 6 years ago

hi,

thank you for the reply, I did not release how to get the debug log from wear app, but I got it with the logcat.

I hope this may help: --------- beginning of crash

E/AndroidRuntime( 2036): FATAL EXCEPTION: main

E/AndroidRuntime( 2036): Process: com.fridgecow.smartalarm, PID: 2036

E/AndroidRuntime( 2036): java.lang.NoClassDefFoundError: Failed resolution of: Lcom/fridgecow/smartalarm/TrackerService;

E/AndroidRuntime( 2036): at com.fridgecow.smartalarm.MainActivity.onCreate(MainActivity.java:109)

E/AndroidRuntime( 2036): at android.app.Activity.performCreate(Activity.java:5990)

E/AndroidRuntime( 2036): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)

E/AndroidRuntime( 2036): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)

E/AndroidRuntime( 2036): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)

E/AndroidRuntime( 2036): at android.app.ActivityThread.access$800(ActivityThread.java:151)

E/AndroidRuntime( 2036): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)

E/AndroidRuntime( 2036): at android.os.Handler.dispatchMessage(Handler.java:102)

E/AndroidRuntime( 2036): at android.os.Looper.loop(Looper.java:135)

E/AndroidRuntime( 2036): at android.app.ActivityThread.main(ActivityThread.java:5254)

E/AndroidRuntime( 2036): at java.lang.reflect.Method.invoke(Native Method)

E/AndroidRuntime( 2036): at java.lang.reflect.Method.invoke(Method.java:372)

E/AndroidRuntime( 2036): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)

E/AndroidRuntime( 2036): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

E/AndroidRuntime( 2036): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.fridgecow.smartalarm.TrackerService" on path: DexPathList[[zip file "/system/framework/com.google.android.wearable.jar", zip file "/data/app/com.fridgecow.smartalarm-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]

E/AndroidRuntime( 2036): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)

E/AndroidRuntime( 2036): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)

E/AndroidRuntime( 2036): at java.lang.ClassLoader.loadClass(ClassLoader.java:469)

E/AndroidRuntime( 2036): ... 14 more

E/AndroidRuntime( 2036): Suppressed: java.lang.NoClassDefFoundError: com.fridgecow.smartalarm.TrackerService

E/AndroidRuntime( 2036): at dalvik.system.DexFile.defineClassNative(Native Method)

E/AndroidRuntime( 2036): at dalvik.system.DexFile.defineClass(DexFile.java:226)

E/AndroidRuntime( 2036): at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:219)

E/AndroidRuntime( 2036): at dalvik.system.DexPathList.findClass(DexPathList.java:321)

E/AndroidRuntime( 2036): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:54)

E/AndroidRuntime( 2036): ... 16 more

E/AndroidRuntime( 2036): Suppressed: java.lang.ClassNotFoundException: com.fridgecow.smartalarm.TrackerService

E/AndroidRuntime( 2036): at java.lang.Class.classForName(Native Method)

E/AndroidRuntime( 2036): at java.lang.BootClassLoader.findClass(ClassLoader.java:781)

E/AndroidRuntime( 2036): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)

E/AndroidRuntime( 2036): at java.lang.ClassLoader.loadClass(ClassLoader.java:504)

E/AndroidRuntime( 2036): ... 15 more

E/AndroidRuntime( 2036): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

fridgecow commented 5 years ago

Sorry for the late reply - it's a strange issue, potentially relating to the way the APK was built (?). I'm not sure how to proceed, but will keep this in mind as something to work on in the future.