cnlohr / rawdrawandroid

Build android apps without any java, entirely in C and Make
MIT License
3.41k stars 215 forks source link

Spectrogrammer #90

Open aguaviva opened 2 days ago

aguaviva commented 2 days ago

I wrote an app using your framework: https://github.com/aguaviva/Spectrogrammer

Still WIP as I am still learning but it should be pretty usable now. I am still using android makefiles :/ but will move to using regular makefiles.

A couple of requests :) I'd be awesome to

Many thanks!

cnlohr commented 2 days ago

Someone else has been working on debugger support - and - rawdraw apps should work on Linux directly, there's just a handful of functions that are mutually exclusive. But they are easily shimmed.

cnlohr commented 2 days ago

Re GDB: https://github.com/cnlohr/rawdrawandroid/pull/87

aguaviva commented 2 days ago

I want to port my stuff to your framework, but I am not sure how to get imgui working, I'd be great if you had a sample I could use as a reference. This is super exciting as it is opening a huge door to get many apps working!

aguaviva commented 2 days ago

OK I think I got it :)

aguaviva commented 2 days ago

Actually, I am almost there! But I keep on getting this error dlopen failed: library "libc++_shared.so"

I tried a few things I saw while googling but nothing worked. Prob you know from the top of your head what is going on?

This is the full error:

10-17 02:26:14.759 20015 20015 E AndroidRuntime: FATAL EXCEPTION: main
10-17 02:26:14.759 20015 20015 E AndroidRuntime: Process: org.yourorg.Spectrogrammer2, PID: 20015
10-17 02:26:14.759 20015 20015 E AndroidRuntime: java.lang.UnsatisfiedLinkError: Unable to load native library "/data/app/~~_GLhycrBMctjXIJep-ULMQ==/org.yourorg.Spectrogrammer2-8kiBxPyUuBBQQVpQzyK_Vg==/lib/arm64/libSpectrogrammer2.so": dlopen failed: library "libc++_shared.so" not found: needed by /data/app/~~_GLhycrBMctjXIJep-ULMQ==/org.yourorg.Spectrogrammer2-8kiBxPyUuBBQQVpQzyK_Vg==/lib/arm64/libSpectrogrammer2.so in namespace clns-4
10-17 02:26:14.759 20015 20015 E AndroidRuntime:    at android.app.NativeActivity.onCreate(NativeActivity.java:178)
10-17 02:26:14.759 20015 20015 E AndroidRuntime:    at android.app.Activity.performCreate(Activity.java:8278)
10-17 02:26:14.759 20015 20015 E AndroidRuntime:    at android.app.Activity.performCreate(Activity.java:8258)
10-17 02:26:14.759 20015 20015 E AndroidRuntime:    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1330)
10-17 02:26:14.759 20015 20015 E AndroidRuntime:    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3609)
10-17 02:26:14.759 20015 20015 E AndroidRuntime:    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3793)
10-17 02:26:14.759 20015 20015 E AndroidRuntime:    at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
10-17 02:26:14.759 20015 20015 E AndroidRuntime:    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
10-17 02:26:14.759 20015 20015 E AndroidRuntime:    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
10-17 02:26:14.759 20015 20015 E AndroidRuntime:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2211)
10-17 02:26:14.759 20015 20015 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:106)
10-17 02:26:14.759 20015 20015 E AndroidRuntime:    at android.os.Looper.loopOnce(Looper.java:201)
10-17 02:26:14.759 20015 20015 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:288)
10-17 02:26:14.759 20015 20015 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:7879)
10-17 02:26:14.759 20015 20015 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
10-17 02:26:14.759 20015 20015 E AndroidRuntime:    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
10-17 02:26:14.759 20015 20015 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1009)
10-17 02:26:14.761  1518  2546 W ActivityTaskManager:   Force finishing activity org.yourorg.Spectrogrammer2/android.app.NativeActivity
10-17 02:26:14.762  1518 20041 I DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2
cnlohr commented 2 days ago

bahhh I didn't realize they wrote parts in C++ :( laaame. I really wish someone would make something like imgui for rawdraw. There was rdui, but that seems to have disappeared...

For the C++ issue, you will need to copy ...Android/Sdk/ndk/21.4.7075529/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++_shared.so into your libs folder as an extra library for deploy.

aguaviva commented 8 hours ago

note there is another libstdc++.a/so here ~/Android/Sdk/ndk/21.4.7075529/platforms/android-21/arch-arm64/usr/lib/libstdc++.a ant it is much smaller,

ouch, so bad, that adds 6MB to the APK and I really love minimalistic stuff. I guess there is no way to link things statically so I can reduce the APK size? If you have any examples feel free to share, I am stiff struggling to get things working.

Also it looks like imgui is an essential bit, I'd be great if your makefile could take care of it :)