Android development

  • 13 Replies
  • 484 Views
*

Offline hakcenter

  • developer
  • Hero Member
  • *****
  • 623
    • 1998 12v Ram
Android development
« on: August 14, 2016, 08:11:06 PM »
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

*

Offline Rx7man

  • Crazy guy
  • Hero Member
  • *****
  • 908
  • Jack of all trades
    • '94 Dodge dually
Re: Android development
« Reply #1 on: August 16, 2016, 01:58:11 PM »
Good job.. I haven't gotten into Android dev yet.. it may happen at some point
'94 dodge, Colt Cam, head worked, NV5600, 3.55's, SB clutch, Ford manual hubs w. hawk brakes, custom flatdeck, custom aluminum bumper, cab off restoration, totally new engine, Mahle pistons @19:1..HE351VE with 67mm turbine and 67x95mm compressor
440hp/1000 ft lb @ 2400 RPM

*

Offline hakcenter

  • developer
  • Hero Member
  • *****
  • 623
    • 1998 12v Ram
Re: Android development
« Reply #2 on: August 16, 2016, 02:02:37 PM »
Let me tell you, its great and sucks at the same time

*

Offline hakcenter

  • developer
  • Hero Member
  • *****
  • 623
    • 1998 12v Ram
Re: Android development
« Reply #3 on: August 16, 2016, 03:50:41 PM »
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

*

Offline hakcenter

  • developer
  • Hero Member
  • *****
  • 623
    • 1998 12v Ram
Re: Android development
« Reply #4 on: August 19, 2016, 03:45:07 PM »
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.

*

Offline hakcenter

  • developer
  • Hero Member
  • *****
  • 623
    • 1998 12v Ram
Re: Android development
« Reply #5 on: August 21, 2016, 07:34:21 PM »
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)

*

Offline hakcenter

  • developer
  • Hero Member
  • *****
  • 623
    • 1998 12v Ram
Re: Android development
« Reply #6 on: August 23, 2016, 08:10:58 PM »
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

*

Offline hakcenter

  • developer
  • Hero Member
  • *****
  • 623
    • 1998 12v Ram
Re: Android development
« Reply #7 on: August 28, 2016, 06:32:45 PM »
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.

*

Offline Rx7man

  • Crazy guy
  • Hero Member
  • *****
  • 908
  • Jack of all trades
    • '94 Dodge dually
Re: Android development
« Reply #8 on: August 31, 2016, 12:46:27 AM »
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 dodge, Colt Cam, head worked, NV5600, 3.55's, SB clutch, Ford manual hubs w. hawk brakes, custom flatdeck, custom aluminum bumper, cab off restoration, totally new engine, Mahle pistons @19:1..HE351VE with 67mm turbine and 67x95mm compressor
440hp/1000 ft lb @ 2400 RPM

*

Offline hakcenter

  • developer
  • Hero Member
  • *****
  • 623
    • 1998 12v Ram
Re: Android development
« Reply #9 on: August 31, 2016, 07:47:30 AM »
Haven't tried the studio on my phone, it worked okay on my Nexus 7 with OTG cable

*

Offline hakcenter

  • developer
  • Hero Member
  • *****
  • 623
    • 1998 12v Ram
Re: Android development
« Reply #10 on: September 04, 2016, 03:18:55 PM »
EEPROM coding added, :) so close to a release on this thing

*

Offline hakcenter

  • developer
  • Hero Member
  • *****
  • 623
    • 1998 12v Ram
Re: Android development
« Reply #11 on: September 04, 2016, 08:53:33 PM »
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)

*

Offline Rx7man

  • Crazy guy
  • Hero Member
  • *****
  • 908
  • Jack of all trades
    • '94 Dodge dually
Re: Android development
« Reply #12 on: September 05, 2016, 12:50:16 AM »
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 dodge, Colt Cam, head worked, NV5600, 3.55's, SB clutch, Ford manual hubs w. hawk brakes, custom flatdeck, custom aluminum bumper, cab off restoration, totally new engine, Mahle pistons @19:1..HE351VE with 67mm turbine and 67x95mm compressor
440hp/1000 ft lb @ 2400 RPM

*

Offline hakcenter

  • developer
  • Hero Member
  • *****
  • 623
    • 1998 12v Ram
Re: Android development
« Reply #13 on: November 17, 2016, 11:17:09 AM »
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.