Main Menu

Android development

Started by hakcenter, August 14, 2016, 08:11:06 PM

hakcenter

Just thought I would make a thread to show progress.

I've got a simple app working so far on my phone, I'll build the serial interface next weekend hopefully.

Android 6.0.1+ and permissions wow. Cyanogenmod (which I'm using) does not follow the standard permissions.. Also the app needs location coarse, just to scan with bluetooth (not to connect) and you can't use the android default stuff on cm. It literally just breaks and crashes...

Instead just try to access location once, get the permission pop-up and accept always. Then phone no break.

Anyways..  Lol
TS2009 Deḇarim 8:2
"And you shall remember that יהוה your Elohim led you all the way these forty years in the wilderness, to humble you, prove you, to know what is in your heart, whether you guard His commands or not.

Rx7man

Good job.. I haven't gotten into Android dev yet.. it may happen at some point
'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles

hakcenter

Let me tell you, its great and sucks at the same time
TS2009 Deḇarim 8:2
"And you shall remember that יהוה your Elohim led you all the way these forty years in the wilderness, to humble you, prove you, to know what is in your heart, whether you guard His commands or not.

hakcenter

#3
Time to start building the basic interface..

I can communicate, and parse info from the Bluetooth connection so a serial interface shouldn't be too difficult to setup on the weekend.

Things are going well, I'm trying to beautify portions, like buttons and clicks and dialogs, even a spinner in the bar while connected.


Then the difficult task of making this thing remember the bluetooth mac you last connected to, auto connect to it without crashing lol
TS2009 Deḇarim 8:2
"And you shall remember that יהוה your Elohim led you all the way these forty years in the wilderness, to humble you, prove you, to know what is in your heart, whether you guard His commands or not.

hakcenter

Things are going pretty good, android still not the funnest thing to program for.

Been able to work on some communique today and talk directly to the LBB as far as curves and rpm points (requires the LBB to on 1.3.0e+)

Hopefully I can start making auto connect / disconnect depending if the app is open. I'm thinking of making a side on/off button that shows its connected at the actionbar, but the UI coding is a real pain in the ass.


It was funny today.. I was thinking, dang it sure would be nice to know if bluetooth is connected... and I totally forgot I connected the paired BT led to ADC5... so you CAN know if the bluetooth is connected lol!

Made it a ton easier, so startup output isn't gigantic and requiring so much garbage collection before communicating.

Hopefully I can record my android screen and talk, highlighting the work so far.
TS2009 Deḇarim 8:2
"And you shall remember that יהוה your Elohim led you all the way these forty years in the wilderness, to humble you, prove you, to know what is in your heart, whether you guard His commands or not.

hakcenter

#5
More screen shots. I'm pretty happy with everything.

If anyone has access to lower android machines like 4.0 / 4.1 / 4.4.2 / 5.0

Let me know, I'd like to put it on real devices and see if it crashes anywhere before I try to put it on Google play. (yes I can emulate but that really..  Doesn't help)
TS2009 Deḇarim 8:2
"And you shall remember that יהוה your Elohim led you all the way these forty years in the wilderness, to humble you, prove you, to know what is in your heart, whether you guard His commands or not.

hakcenter

For those with android devices, I could use a lot of feedback even if you don't have the device. I need to know potential crashes, startup issues.. etc..

Even trying to connect to the wrong BT device.. lots of stuff

Join the alpha testing @ https://play.google.com/apps/testing/com.devnull.lbb
TS2009 Deḇarim 8:2
"And you shall remember that יהוה your Elohim led you all the way these forty years in the wilderness, to humble you, prove you, to know what is in your heart, whether you guard His commands or not.

hakcenter

So this is still working pretty good. I've tracked down the last real big hiccup, apparently on bluetooth disconnect, is a global. So when my phone disconnects from the radio, or the radio decides to be weird, it would randomly disconnect my app.

Setup app to only close out the connection when the bluetooth disconnection only comes from the connected device (that took quite a bit to figure out) no more random disconnects!

Data thread is properly stopped while refreshing / setting the tuning page. Need to setup a communique for storing values in the LBB eeprom and commit values, and it is pretty much good to go.


It sure is nice, just whipping out the phone and testing different curve settings or just logging values.
TS2009 Deḇarim 8:2
"And you shall remember that יהוה your Elohim led you all the way these forty years in the wilderness, to humble you, prove you, to know what is in your heart, whether you guard His commands or not.

Rx7man

I just downloaded android studio, but it wants to download 300mb more crap (SDK's etc) and I can't do it from home.. grumbles..
'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles

hakcenter

Haven't tried the studio on my phone, it worked okay on my Nexus 7 with OTG cable
TS2009 Deḇarim 8:2
"And you shall remember that יהוה your Elohim led you all the way these forty years in the wilderness, to humble you, prove you, to know what is in your heart, whether you guard His commands or not.

hakcenter

EEPROM coding added, :) so close to a release on this thing
TS2009 Deḇarim 8:2
"And you shall remember that יהוה your Elohim led you all the way these forty years in the wilderness, to humble you, prove you, to know what is in your heart, whether you guard His commands or not.

hakcenter

#11
So here's what I got.

It's rock solid. Preferences for auto connecting / refreshing data / keeping the screen on while connected.

Tuning your current curve, I'm not going to setup pragmatically changing curves on the fly, it seems like a waste of time when you can adjust the current curve on the fly. Only thing left is to add 'default' values so in case it gets all wonky. You can commit the values to the units eeprom, and it will save between startups..  :o

Logging, is to be determined at this point.. probably some kind of cvs file or something.

Bluetooth settings work great, open it up, find your device, pair it. If you're on older android versions you may need to pair through the standard BT interface (works fine on my cm13 phone though)

Can't get to BT settings while connected, connecting to device from any screen (cause it is in the bar) pushes you right to the main screen no matter what. Only after all the garbage has been collected off the bluetooth buffer (there can be a lot if you manually reboot your unit from the switch, without key on/off scenarios)
TS2009 Deḇarim 8:2
"And you shall remember that יהוה your Elohim led you all the way these forty years in the wilderness, to humble you, prove you, to know what is in your heart, whether you guard His commands or not.

Rx7man

Nice... at some point I'll work on something like that.. If I ever get the R-Pi hooked up it'll have one screen and the phone can do double duty with other displays.. would be kinda cool.. it's a LONG ways off
'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles

hakcenter

Man I love that I made this app, tuning has never been easier. I've got a few more booleans to setup and then sit on it for awhile trying to figure out if logging is even necessary.
TS2009 Deḇarim 8:2
"And you shall remember that יהוה your Elohim led you all the way these forty years in the wilderness, to humble you, prove you, to know what is in your heart, whether you guard His commands or not.

hakcenter

I know it's been awhile, but I'll be rolling an update out probably tomorrow, tightening up stability and adding a new option for bulk data communication. Your LBB will need to updated with the newer serial code to make that option work, but it's a ton faster for data turn around.
TS2009 Deḇarim 8:2
"And you shall remember that יהוה your Elohim led you all the way these forty years in the wilderness, to humble you, prove you, to know what is in your heart, whether you guard His commands or not.