2

I have a Qi charger in my car and I wanted that my phone launched the dash cam app when the phone starts charging on this base. Is there any API to detect the ID of the Qi charger? Besides the API, is there any way to generate an event when the phone starts charging?

  • 1
    You can try automation apps, like Macrodroid. Macro:: Trigger- power connected ; Action - launch app ( choose dashcam app); Constraints WiFi not connected to your home network ( to make sure it didn't launch app when charging at home/ office). Let me know if this meets your needs to post solution – beeshyams Oct 27 '16 at 18:14
  • It is an interesting possibility, but I would still like to know if the ID of the Qi charging base is readable so that I could also create other possibilities. – Gabriel Diego Oct 27 '16 at 18:36
  • I doubt it. When you plug in nothing else but the voltage and current levels are detected by the phone. Special chargers like fast chargers and quick chargers identify themselves to the circuitry inside the phone by these and additional parameters but you can't differentiate between OEM fast charger or say unbranded fast charger. If such a capability was there, don't you think OEM's would love to say you can't charge with any other charger other than mine and tie you down ?:) – beeshyams Oct 27 '16 at 18:47
  • Maybe this is the answer :-) – Gabriel Diego Oct 27 '16 at 18:48
  • Also doubt if that is available in API , though I am not a developer. Else won't you see apps to tell you if the charger was original or fake or if the charger brands is xxxx?? – beeshyams Oct 27 '16 at 18:49
1

Type of Charging is determined by :

  • Charging Signature - see here

  • The D+ and D- pins of the cable that negotiate the charging voltage and current with the device, in tune with the charging circuitry in the charger (see Overview of USB Charging for more

  • So a Qi charger would be recognised by the internal circuitry in the device and voltage / current negotiated with the battery charger circuit , depending on the charge level of battery

I am not aware if the API provides information regarding the make or brand or ID of charging, to use that to trigger any action. If available , that would be so very convenient for OEM's to tie users to their own chargers as a sales strategy :). I have also not come across any evidence in the charging algorithms published by charging IC manufacturers. This is not a definite conclusion though


Coming to your requirement, is the preferred option. Many apps are available. I prefer using MacroDroid , since it is free (upto 5 macros) and easy to learn. To understand how MacroDroid works and required settings, my answer here


Your macro would look like this

  • Macro : Dashcam (name of macro )

Trigger: Power connected / removedPower connected

Action: Launch application → Select from drop down your dashcam app

Constraints: WiFi State → WiFi not connected to network ( assumption here is that when you are in your car you are not connected to any WiFI network. When you are connected to any network say at work or home, and charging this macro will not run, meaning your dashcam will not be launched)

Alternative constraint suggested by OP, an excellent one ( thanks ) is

Bluetooth State:Device connected

|improve this answer|||||
  • 1
    An even better constraint would be connected to Bluetooth in the car. – Gabriel Diego Oct 27 '16 at 20:16
  • Yes.. That's a good idea. Thanks for that. You can go ahead and use that. I will edit for the benefit of others. Thanks for accepting – beeshyams Oct 27 '16 at 20:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.