FORUMS
Remove All Ads from XDA

[Android 4.1+] HeadUnit Reloaded for Android Auto with Wifi

568 posts
Thanks Meter: 252
 
By Emil Borconi, Senior Member on 4th August 2016, 01:47 AM
Post Reply Email Thread
This Threader is a Spin-off of the original: [Android 4.1+] Headunit for Android Auto - 160117 - Self Mode+ other fixes, x86, 720p by the late @mikereidis.

Last edited: 15/01/2017
IF YOU UPGRADED TO ANDROID AUTO 2.X

Dial Pad is broken - Workaround available:
- Open AA -> About -> 3 dot menu -> Developer settings -> Application mode -> change to developer. This will bring back the Dial screen.

Updated trial version to the latest build.

Version 2.4 Released
- Improved performance (Wifi should be on par with USB now, even with Audio transport enabled)
- Improved touch sync (no accidental long touches and other strange occasional bugs)
- Option to share the GPS with the phone (reduce battery usage footprint on phone)
- Final fixes for Day/Night calculation and theme switching
- Auto volume adjust fixes (on supported ROM, the volume adjuster is hidden from the user)
- Software decoding works with Audio as well.


Version 2.3 Released
- Improvements and fixes for auto volume adjust
- Improvements and fixes for hardware key input
- Wifi speed improvements (should be able to run smoothly even with transport sound enabled)
- Tweaks for SelfMode (home and recent app button can be used to gracefully exit the app)
And the biggest change:
- Unlimited Browsing support - This is experimental and hacky it's possible that Google will close the loophole at some point but for the time being it works.




Version 2.2 Released - With some major changes
- Fixes for Communication Error 2 received with Play Service 10.X
- New Self mode
- Corrected channels order
- Unlimited browsing working when car is parked (only for Android Auto 1.6)
- Totally changed the Day/Night toggle logic, now the calculations are done inside the headunit app and updated each 10 minutes, so if you're driving all day the sunset/sunrise should be correct. even if you are 500 miles more to the north or west or whatever.
- Added Auto adjust volume option (works for bluetooth audio as well).
- Changed all the key mapping, and using real keys instead of simulated touches:

Supported hardware keys:
  1. Volume Up
  2. Volume Down
  3. Media Next
  4. Media Prev
  5. Media Play
  6. Media Stop
  7. Media Rewind
  8. Phone answer key (In case of incoming call it will answer the call, in case of not being on a call it will take you to the dial pad
  9. F key - Same as Phone Key
  10. D key - Changes to Day theme
  11. N Key - Changes to Night theme
  12. M Key - Mic
  13. H Key - Takes you to home screen
The following keys are still usable but they are based on simulated touches:
  • Up Arrow = Scroll Up
  • Down Arrow = Scroll Down
  • Left Arrow = Moves to next Left tab
  • Right Arrow - Moves to next right tab



Version 2.0 Released
Changelog:
- Fixed calculated night mode
- Added support for Software decoding (should work now with any device) - If you have problems running HUR, go to settings and enable Software decoding. Do not use software decoding with audio transport, the audio playback will suffer a lot, consider streaming the audio from the phone to a A2DP directly or using a cable to connect the phone Jack to the stereo AUX, or if your phone is rooted you might want to consider Wifi Audio streaming app, it's too much to ask from the Software decoder to do both Audio and Video, unless you have a very strong CPU, but if that is the case I'm pretty confident that the Hardware decoding will work on the device.
- Added option for letterbox display (prevent distortion of stretch)
- Added option to start the app when connected to Wifi

Software Decoding
- Based on the feedback although it works, I'm not recommending this app for those with Joying or any other Rockchip (RK3188, RK3066) powered headunit. Feel free to use the trial and decide yourself, but it appears to be painfully slow on those devices.


Version 1.5 Released - Key features
- Stable Wifi connection
- Added support for Android 7.0 (Self mode as well)
- Self mode running in stable and usable way
- Connecting USB cable will start app automatically (even if phone is running Android 6.0 or 7.0)
- Supports keyboard shortcuts:
  1. M = Start the Mic
  2. N = Navigation Tab
  3. P = Phone Tab
  4. H = Home Tab
  5. E = Entertainment Tab
  6. UP Arrow = Scroll Up
  7. Down Arrow = Scroll Down
  8. Left Arrow = Moves to next Left tab
  9. Right Arrow - Moves to next right tab
  10. S = Play/Pause button (only works in Entertainment tab)
  11. F = Next track (only works in Entertainment tab)
  12. R = Prev Track (only works in Entertainment tab)
- Uses light sensor (if available) for toggling Day/Night theme.


If you are updating from version older than 1.2 please read:
You won't be able to install it over the old one (Key signature changed!), so please uninstall the previous version before updating, HOWEVER if you were upgraded for free from Mike's version, please follow this steps:
1) On XDA Labs, click the download Stable
2) When prompted to install select Cancel
3) Open a file explorer and go to Storage -> Android -> com.xda.labs -> files
4) Locate the newly download APK and copy it somewhere else.
5) Uninstall the old version
6) Install the APK which you just copied.
If you miss any of the steps, just reinstall the old version you received from me by email and try again, let me know if you are stuck.

App requirements:
- Android 4.1 or higher
- H264 Hardware decoding!

How to use the app: (Please read this steps before asking for help)
1) USB OTG
- Plug in the OTG cable to your tablet, connect your phone, done!

2) Self mode (for AA 2.0) - See Video
- Start Android Auto, Go to About, if you are not a developer yet press the "Android Auto" header 10 times, from the 3 dotted menu select "Start Head Unit Serve"
- Exit Android Auto
- Start HUR and select Self

3) Wifi
- From the phone create a Wifi hotspot
- Start Android Auto, Go to About, if you are not a developer yet press the "Android Auto" header 10 times, from the 3 dotted menu select "Start Head Unit Serve"
- Connect your tablet to the newly created Wifi hotspot
- Start the Headunit Reloaded app
- HTC ATTENTION! If your phone is a HTC, please change the default IP address to: 192.168.1.1
- Select Wifi

4) Wifi Direct (not supported by all phones/tables)
- Start Headunit Reloaded on the tablet
- Select Wifi Direct
- On the phone go to Settings -> Wifi -> Advanced -> Wifi Direct, join the group. (Do not try to connect as to a normal Wifi it will not work!)
- On the phone start Android Auto, Go to About, if you are not a developer yet press the "Android Auto" header 10 times, from the 3 dotted menu select "Start Head Unit Serve"

Other important notes:
Software Decoding
- Based on the feedback although it works, I'm not recommending this app for those with Joying or any other Rockchip (RK3188, RK3066) powered headunit. Feel free to use the trial and decide yourself, but it appears to be painfully slow on those devices.

To exit the app
If you are connected with USB, just unplug the USB cable, DO NOT use the exit from the menu. If you are running Wifi, Wifi Direct or Self mode, ALWAYS use the exit button from the left drawer menu!

Audio transport option
Will forward (sink) all the audio from the phone to the tablet if enabled, EXCEPT phone call audio, that will go trough the phone speakers or Bluetooth Handsfree if connected. If you wish to stream all the audio from the phone directly to your A2DP bluetooth, then simply disable the Transport Audio option.

Day/Night toggle
The device running the Headunit Reloaded app will be responsible for changing the theme. You can chose between using the light sensor of the device to toggle between day and night mode, or you can use calculated sunset sunrise mode, or even force it to one theme only. If you have previously installed AA Helper to your phone, please uninstall it!

Auto Start on Wifi
This option will launch HUR whenever you are connected to a Wifi (specific Wifi can be named)

Auto increase volume on speed
The logic behind is a very simple approach, every time the speed increases it will send a vol + key to the phone and every time the speed decrease it will send a vol - to the phone. This requires the device running HUR to have a GPS receiver.



OLD STUFF:

Version 1.3 (Wishlist version) - Released
- Added option for easy car mode toggling. (Car mode can be disabled if not using Self mode - avoid conflict with other Car apps)
- Auto Hide status + action bar while running the app no need to use the Hide option from menu
- App will automatically close when Wifi connection is lost


Version 1.2b - Released
- Buffer overflow protection - Special Thanks to invis-zz from GitHub (https://github.com/invisi-zz) - This should random crashes while using the app.
- Removed Send Log feature (it was classed as backdoor/trojan and Google was blocking the app on playstore)
- Updated OpenSSL library to 1.0.1t (used OpenSSL contained vulnerabilities and Play store blocked the app)
- Managed to get the app on PlayStore (wonder if it will stay...) - https://play.google.com/store/apps/details?id=gb.xxy.hr
Signature Key changed!!!!
I had to update the APK signature key (I'm trying my luck with Play Store), this means if you try to install the new version you won't be able to install it over the old one, so please uninstall the previous version before updating, HOWEVER if you were upgraded for free from Mike's version, please follow this steps:
1) On XDA Labs, click the download Stable
2) When prompted to install select Cancel
3) Open a file explorer and go to Storage -> Android -> com.xda.labs -> files
4) Locate the newly download APK and copy it somewhere else.
5) Uninstall the old version
6) Install the APK which you just copied.
If you miss any of the steps, just reinstall the old version you received from me by email and try again, let me know if you are stuck.



Version 1.1 Stable - Released
Jumping the version number due to significant amount of changes:
  • Removed Day/Night/Auto mode (see bottom of this post for a better solution.)
  • Added new setting for 720p Video - Fully working now (even on Wifi)
  • Changed Self mode start sequence (if the phone is rooted it will start automatically and then go back to HU), if your device is not rooted, please use the following sequence to start Self mode:
    1. Start HU app
    2. Select Self mode
    3. When AA opens select Start Developer Server
  • Added support for hardware keys (simulating touches), so if your tablet is integrated with the car remote you can control AA from the remote.
    Hardware keys as follow:
    1. M = Start the Mic
    2. N = Navigation Tab
    3. P = Phone Tab
    4. H = Home Tab
    5. E = Entertainment Tab
    6. UP Arrow = Scroll Up
    7. Down Arrow = Scroll Down
    8. Left Arrow = Moves to next Left tab
    9. Right Arrow - Moves to next right tab
    10. S = Play/Pause button (only works in Entertainment tab)
    11. F = Next track (only works in Entertainment tab)
    12. R = Prev Track (only works in Entertainment tab)
  • Some other minor tweaks, to improve stability and make Self mode connect 9 out of 10 times.
  • Fully integrated x86 native binaries
  • Declared app as CAR HOME, for those using SelfMode it is crucial, that when you get prompted which should be the default CAR HOME app (Android Auto or HU) you select HU!!! - This is needed to be able to bring back the HU on top after a successful connection is established. AA is trying to override everything..... and to block the user out of his phone as soon as it's connected to the car.
  • Transport Audio option will affect USB connections as well (You can keep the audio on your phone/bluetooth, when connected with the OTG cable)



Version 1.03b released - Beta

- You will find it in XDA Labs (under the Beta version)
- Fixes Wifi/Self mode for some devices which didn't connect before
- Increased stream buffer size to match the DesktopHeadUnit app (128Kb vs 64Kb)


Version 1.02 release
- Fixed wifi not connecting on some device only after numerous attempts (see explanation below if interested)

The issue looks to be related to the timing, on some occasions and on some devices the phone either sends the SSL data too soon, either too late, either to slow and because the TCP socket is set to non-blocking mode, it can end up in a missed packet in the initial Handshake. I have tweaked this now, so the TCP socket will connect in non-blocking mode, but will switch to blocking mode and wait for full message after a successful connection and once the SSL Handshake is out of the way it will revert back to non-blocking mode, uhhh event reading this makes me dizzy
This however could make the initial startup slightly slower than it was.

- Corrected AutoStart option (Working properly now)
- Fixed USB device overlapping Settings text on the drawer menu
- Added "Send Log" function to be used if there are problems for easier debugging.


Version 1.01 released

- Potential Wifi disconnect fix (see: http://forum.xda-developers.com/show...5&postcount=16 for details)
- AutoStart option added to the menu


Very sadly Mike passed away this year and his software stopped working after a Google Update, he left us a slightly outdated GPLv3 version of the software at: https://github.com/mikereidis/headunit which I have used to rebuild (or ty to) rebuild up to his latest build with some additional small modifications as well as fixing the issue caused by Google.

The forked version can be found on: https://github.com/borconi/headunit if anybody is intersted.

Since the app released by him isn't working any longer I have created the new version of it and slightly re-name it just to avoid any confusion.

I take almost no credit in this app, except for some minor changes, and finding the fix for what Google have broke (changed), which was a painful task.

I'm not a developer as such, and this app would never have existed if it wasn't for @mikereidis, however I have spent now several weeks studying the app and understanding how it's working and I plan to continue with the maintenance/development of the app.


I have published the app on XDA Labs under the new name: "Headunit Reloaded Android Auto" and it is now available for purchase. As I have stated previously I'm intending to support all of Mike's customers, so if you have purchased Mike's application before, please email me a proof of purchase to borconie@gmail.com and you can have a free copy of the spin-off app.

How to use (Self / Wifi / Wifip2p) ?
1) Self mode.
See instructions in version 1.1

2) Wifi Mode
Start AA on your phone, tap the header 20 times till you become a developer, once that is completed from the menu select Start Head Unit server. Now start tethering on the phone, connect the tablet to the newly created wifi hotspot, start HU on your tablet and select Wifi. This will make the HU app try to connect to the default Android gateway (192.168.43.1), if you need to change this, use the Settings menu from the HU option list. If HU doesn't start on first, do try a few more times, first setup sometimes proves tricky. If this is the first time you connect your phone to the a HU, please make sure you answer all the questions on the phone.

3) Wifi p2p
This is not supported by all devices and might not work for your device, plus sometimes it can be slightly buggy. Start WifiP2p on the tablet from the HU. On the phone go to Wifi Direct (this is usually found in Advanced Wifi settings settings - DON'T TRY TO CONNECT LIKE TO A NORMAL WIFI and look for a new available connection. If you can see one tap to join. Once you joined the network, give it about 30 seconds or so, then open the AA on the phone and start the head unit developer server (same as describe it above). If you're lucky it will work instantly, if not you might need to play around with it.


Other Options:
Possibility to toggle the Audio mirroring when using a Wifi connection. By disabling the Audio mirroring, you will keep all the audio on your phone rather than on the tablet (or on the handsfree) if the phone is connected to the handsfree. This will improve the performance greatly, since audio will use up a significant quantity of Wifi bandwidth when communicating between the 2 device.


USB OTG connection.
Have remained unchanged and it will work same way it did till now, see original threader for details.

I will monitor both Threads and will do my best to help and support everybody.



Self Mode Demo
Attached Files
File Type: apk AA helper.apk - [Click for QR Code] (2.45 MB, 932 views)
File Type: apk hu-trial-release.apk - [Click for QR Code] (3.71 MB, 196 views)
The Following 11 Users Say Thank You to Emil Borconi For This Useful Post: [ View ] Gift Emil Borconi Ad-Free
 
 
4th August 2016, 04:21 AM |#3  
Junior Member
Thanks Meter: 3
 
More
*Purchased

Also cloned and starting to build it as am having issues with my Joying head unit showing black screen after connecting (Test shows a black screen also).
looking forward to getting this running.
4th August 2016, 05:33 AM |#4  
Senior Member
Thanks Meter: 749
 
More
Quote:
Originally Posted by Syphe

*Purchased

Also cloned and starting to build it as am having issues with my Joying head unit showing black screen after connecting (Test shows a black screen also).
looking forward to getting this running.

What version of Android is your unit running? I haven't heard of any with less than lollipop being able to run this so far, h.264 decoding is absent or poorly implemented.
Edit....see the bottom of this post
http://forum.xda-developers.com/show...postcount=1449
The Following User Says Thank You to adfurgerson For This Useful Post: [ View ] Gift adfurgerson Ad-Free
4th August 2016, 10:17 AM |#5  
OP Senior Member
Flag Wakefield
Thanks Meter: 252
 
Donate to Me
More
Quote:
Originally Posted by Syphe

*Purchased

Also cloned and starting to build it as am having issues with my Joying head unit showing black screen after connecting (Test shows a black screen also).
looking forward to getting this running.

Hi Syphe.

The core of the app is the same as the original, and the app does require a hardware H264 decoding supported by the OS. Till now we are not aware of any chinese HU which support this. Please contact me by email and I'll refund your purchase.
4th August 2016, 12:42 PM |#6  
Senior Member
Thanks Meter: 39
 
More
Quote:
Originally Posted by Emil Borconi

Hi Syphe.

The core of the app is the same as the original, and the app does require a hardware H264 decoding supported by the OS. Till now we are not aware of any chinese HU which support this. Please contact me by email and I'll refund your purchase.

You might want to post a "demo" version with just Mike's test mode that plays an H.264 screencap of AAuto running. Would be a good requirement-diagnostic app to have on hand, wouldn't take much time to bake - and it wouldn't have to track source either...

Just be sure to have it display a message popup saying that this is only a requirement check app, not an interactive demo. Something that informs users that its sole purpose is to make sure the decoders work. Maybe call it "Headunit Decoder Requirement Check.apk"
4th August 2016, 12:52 PM |#7  
OP Senior Member
Flag Wakefield
Thanks Meter: 252
 
Donate to Me
More
Quote:
Originally Posted by Christopher Price

You might want to post a "demo" version with just Mike's test mode that plays an H.264 screencap of AAuto running. Would be a good requirement-diagnostic app to have on hand, wouldn't take much time to bake - and it wouldn't have to track source either...

Just be sure to have it display a message popup saying that this is only a requirement check app, not an interactive demo. Something that informs users that its sole purpose is to make sure the decoders work. Maybe call it "Headunit Decoder Requirement Check.apk"

Yeah I thought about that myself.... will probably create a small check app in the near future (just need to catch up with all my other work now, which has been pushed behind to get this done)
4th August 2016, 10:09 PM |#8  
Junior Member
Thanks Meter: 3
 
More
bugger, thought it was quite promising when everything started to connect itself

I've been building my own app to do simple notification mirroring over a wifi tether, but this would have been much easier haha.
The Following User Says Thank You to Syphe For This Useful Post: [ View ] Gift Syphe Ad-Free
5th August 2016, 04:33 AM |#9  
Junior Member
Thanks Meter: 3
 
More
Does anyone know if there is a problem with xda labs on marshmallow or something? I've been trying to download this head unit app for the past week (was trying the old one and now this new one) and every time I click the pay now button for PayPal it just hangs there saying "Contacting PayPal". Is there maybe some other way to purchase the app? Any help would be appreciated, I really want to try this app out!
5th August 2016, 09:22 AM |#10  
OP Senior Member
Flag Wakefield
Thanks Meter: 252
 
Donate to Me
More
Quote:
Originally Posted by kevster0522

Does anyone know if there is a problem with xda labs on marshmallow or something? I've been trying to download this head unit app for the past week (was trying the old one and now this new one) and every time I click the pay now button for PayPal it just hangs there saying "Contacting PayPal". Is there maybe some other way to purchase the app? Any help would be appreciated, I really want to try this app out!

Hi.

Yeah the XDA labs app can sometimes play funny, if your having any kind of issues feel free to contact me directly be email, on borconie@gmail.com
5th August 2016, 08:27 PM |#11  
Senior Member
Thanks Meter: 20
 
More
Hi Emil,

I had a chance to play with your new version. I got it to work, however it was not simple and I have a few issues.

I'm using it in WiFi mode. My Android TV stick(5.1.1) runs HeadUnit app and is connecting to my phone (Samsung Galaxy S7 Edge) that runs WiFi hotspot option.
The problem is that I need to click WiFi (in the menu of HU) many times for it to connect to my phone. It can take 5 to 15 clicks on Wifi option in HU for the phone to connect.
Is it the same for you? Any idea what can be the problem?

Also, I'd like to automate it somehow. I'm not using USB, so I'd like the HU app to be always ready for WiFi connection. Is it possible?

Thank you!

P.S.: I have some other issues/comments as well, but I'll keep them for later
Post Reply Subscribe to Thread

Tags
android auto, androidauto, headunit

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes