Android Battery Lib, Java FFI example

LiveCode Builder is a language for extending LiveCode's capabilities, creating new object types as Widgets, and libraries that access lower-level APIs in OSes, applications, and DLLs.

Moderators: LCMark, LCfraser

Post Reply
PaulDaMacMan
Posts: 616
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Android Battery Lib, Java FFI example

Post by PaulDaMacMan » Thu Apr 27, 2017 4:30 am

I set up a git hub project based on the Android Battery Lib example from Ali Loyd's blog post https://livecode.com/livecode-9-0-dp-6- ... e-preview/
I added a few more functions, but some of them may not be working properly. The voltage & technology functions are not returning info on my device (Galaxy Note 5, Android 7.0), but the others are working fine.
https://github.com/PaulMcClernan/LCAndroidBatteryLib
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Android Battery Lib, Java FFI example

Post by capellan » Thu Apr 27, 2017 2:29 pm

Hi Paul,

Do you have an APK that we could install in our Android device?

Al

PaulDaMacMan
Posts: 616
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: Android Battery Lib, Java FFI example

Post by PaulDaMacMan » Fri Apr 28, 2017 5:09 am

capellan wrote:Hi Paul,

Do you have an APK that we could install in our Android device?

Al
Well I could upload my .apk build I guess, but I don't see the point in doing that.
There is a stack in my repo called GetBatteryTest.livecode that I used to build a test .apk from.
More importantly you need to build the battery lib extension from LCAndroidBatteryLibExp.lcb to include in the test .apk first.
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Android Battery Lib, Java FFI example

Post by capellan » Sat Apr 29, 2017 3:04 am

At least in my own case, my Linux computer (that compile
Android Apps) is out of service until new RAM memory
arrives from an online store... :(

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Android Battery Lib, Java FFI example

Post by FourthWorld » Sat Apr 29, 2017 5:21 am

capellan wrote:At least in my own case, my Linux computer (that compile
Android Apps) is out of service until new RAM memory
arrives from an online store... :(
I know your pain, Alejandro. It's happened to me before. If it's not RAM it's hard drives. Hang in there, and maybe catch up on some old movies while you're waiting for the chips to arrive. :)
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

PaulDaMacMan
Posts: 616
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: Android Battery Lib, Java FFI example

Post by PaulDaMacMan » Sat Apr 29, 2017 5:01 pm

OK I uploaded my test apk to the git repo
I haven't worked on this again since.
Two functions, GetBatteryTechnology() & GetBatteryVoltage() don't seem to work and return nothing on my phone.
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Android Battery Lib, Java FFI example

Post by capellan » Sat Apr 29, 2017 8:13 pm

@ Paul, Many Thanks for posting this APK! I downloaded it and try to install.
Which Android version requires this apk?

@ Richard, Patience is my best friend! :D

Al

PaulDaMacMan
Posts: 616
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: Android Battery Lib, Java FFI example

Post by PaulDaMacMan » Mon May 01, 2017 5:25 pm

capellan wrote:@ Paul, Many Thanks for posting this APK! I downloaded it and try to install.
Which Android version requires this apk?

@ Richard, Patience is my best friend! :D

Al
Oh I think I had it set for Android 5 due to having problems at first, it should probably be changed back to 4 as I don't think 5 was actually needed.
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

PaulDaMacMan
Posts: 616
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: Android Battery Lib, Java FFI example

Post by PaulDaMacMan » Mon May 01, 2017 5:31 pm

Uploaded Android 4 version to GitHub:
Get Battery Tests ICS.apk
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

Post Reply

Return to “LiveCode Builder”