[IDEA] Led as Light and Proximity Sensors - Android Software Development

I'm not a Developer, but reading some information (i.e. http://www.arduino.cc/playground/Learning/LEDSensor ) I thought that if the leds of our phone (I'm thinking about the G1, 'cause I have it ) is connected to a pin that can be input and output at the same time, we may use it as a Light Sensor! But we need some dev that gives sw support for it...
And then, we may tell Android that the behaviour of the Light Sensor has to invert when we answer a call, and then we have a Proximity Sensor!
If someone could implement this, the devices that doesn't have a Light or Proximity Sensor could have something like it! And we just need a led!
It's just an Idea, but I think it could be awesome. What do you think about that?
[EDIT] we may need to see how long a led takes to shut himself down, and use the data to tell the system to change the backlight... using GPIO controls? [/EDIT]

yeah, thats not bad of an idea. I came from windows mobile and devs made an app for this exact purpose. maybe someone can do it for android as well.

I talked to a person that develops for embedded systems and I he said it would be difficult... He had no good result... But I don't think we're lost, if you say that it's really possible, maybe we can do it

haha i know its possible because it has been done and works on the Touch HD (my prev device) which coincidentally has the same hardware as the Hero. Its a definite possiblity, just that I don't know anything about writing programs for Hero. But my guess is that root access would be a must since you're modifying the usage of the light sensor

Then we just need devs!

Try asking the Dev that made the Leds flash for Sdcard activity, it looks really cool when you use it:
http://forum.xda-developers.com/showthread.php?t=690914

Ace42 said:
Try asking the Dev that made the Leds flash for Sdcard activity, it looks really cool when you use it:
http://forum.xda-developers.com/showthread.php?t=690914
Click to expand...
Click to collapse
But it's not the same thing, I may ask but now we need to use the led to capture light, not to send it...

Related

Camera Light as Notification LED

Would it be possible to make the camera light flash when an event occurs. For instance, when a call is received, or when you receive a message. I for one tend to put my pda face down on my desk, just in case something falls on it (It also prevents dust from collecting on it, as it's a bugger to clean off) so it would be a novel use for the light. The camera light woul definitely draw attention to the phone, much more than the little orange flashing light that's there atm...
Anyone know of anything which may do the job?
---
Posted From My Wizard
extremly good question would make sense.
lets see what we come up with.
-Brian
VJCandela could quite easily be modified to do this.
It doesn't support the Wizard though, I've never had one to debug on
V
vijay555 said:
VJCandela could quite easily be modified to do this.
It doesn't support the Wizard though, I've never had one to debug on
V
Click to expand...
Click to collapse
Well I love mine far to much to commit it for scientific research
Why can't all of these little bits of hardware all be accessed in the same way on all devices... It's silly having to access them directly. It's a bit like the sounds and notifications thingy. There are loads of notifications, so why can't we change them all without having to install other programs? Because you can in the full blown windows...
Yes, but on PCs the hardware has to be made hardware compatible, or interfaced by appropriate drivers. On the PPC you're not working to a strict hardware platform, so you get different cameras, different scrollwheels, different audio etc. And that's even just withinHTC.
We're working at a driver level, or even worse, hardware level, and that requires some device specific work.
If it's any consolation, the Hermes and the Universal are much more similar then the Wizard and the Hermes, for example. So perhaps things are moving in the right direction.
V
vijay555 said:
Yes, but on PCs the hardware has to be made hardware compatible, or interfaced by appropriate drivers. On the PPC you're not working to a strict hardware platform, so you get different cameras, different scrollwheels, different audio etc. And that's even just withinHTC.
We're working at a driver level, or even worse, hardware level, and that requires some device specific work.
If it's any consolation, the Hermes and the Universal are much more similar then the Wizard and the Hermes, for example. So perhaps things are moving in the right direction.
V
Click to expand...
Click to collapse
Granted the platform differs, however, there should be a method to activate and de-activate the camera flash that's semi universal, I refuse to believe the camera application that comes with the wizard is written specifically for it.
nKrypteD1 said:
Granted the platform differs, however, there should be a method to activate and de-activate the camera flash that's semi universal, I refuse to believe the camera application that comes with the wizard is written specifically for it.
Click to expand...
Click to collapse
Yeah, this is essentially what I was getting at myself, I just didn't know how to word it at the time...

How to enable camera light

Hi
Can any body tell me how to enable camera's light on my MDA ?
http://www.vijay555.com/?Releases:VJCandela
Doesn't work for me. You may have better luck. Be careful and do not leave the light on for extended amounts of time.
outside the basic open up the camera program (default htc one) and click on the flash button...i haven't seen any real cabs for it, except vijay...but i believe that just makes your screen all white, which is bright enough like a light...
No, VJCandela doesn't and has never supported the Wizard.
I don't have a wizard to play with, so could never test code I've written.
I think I know how to do it, but won't write it 'till I can test it.
Hopefully one day!
V

[REQ] Backlight fading in and out app

Is there a brave soul out there who could develope an app that makes the back light fade in when the screen turns on, instead of just switching on, and make it fade out, first to the dim level, then off? It would be pretty neat, if there was an app like that.
It works like that automatically on the newer devices(TP, Diamond, HD)
I Don't know how HTC implemented it but it sounds possible on older devices.
Oooh. It would be awesome if this was possible on older devices, like the HTC Vogue. I hope some dev makes this.
There was a thread just like this that I started, and also one that I posted in, basically it is possible through software as when i use android on my Tilt, the backlight fades like you are saying. But not in windows mobile.
Though I dont know much about it I believe the newer devices do this on a hardware side of things. But in our case it should be very well possible.
no sir... it only on the diamond...
my Touch HD does not fade... wehn i press the standby button...
shadowline said:
There was a thread just like this that I started, and also one that I posted in, basically it is possible through software as when i use android on my Tilt, the backlight fades like you are saying. But not in windows mobile.
Though I dont know much about it I believe the newer devices do this on a hardware side of things. But in our case it should be very well possible.
Click to expand...
Click to collapse
Yeah, I got the idea from Android as well. I thought it was impossible due to hardware limitations, but when it worked on Android, I have gotten very hopeful.
Someone got it working on a certain processor, with the MotoQ smartphones.
http://forum.ppcgeeks.com/showthread.php?t=23553
Someone tried making an app like that for our phones(Vogue, Kaiser, etc.), but it was too glitchy and incomplete.
http://forum.xda-developers.com/showthread.php?t=384543

Working on a Track app for motorcycles

Hi all,
I'm relatively new to the WinMo programming, but so far I've been able to capture and process the Gsensor data, but I can't seem to understand how to use the GPS data.
I want an app that will record the GPS position along with all of the Gsensor data so that I can record the route and have data for each point that contains lean angle, acceleration, deceleration, etc. I figure I'll have to have the Gsensor fill in for some of the GPS data and vice-versa.
Why you ask?
Well, let's say you put it in a suspension test mode. You could accelerate gradually and brake. Hopefully the gsensor could catch the dive and bobble of the bike and give you some feedback. Knowing how far you are leaning in some turns is nice. You could possible detect and calculate if you are sliding at all. Perhaps you could even calculate the power output if you included the weight. You could make a mode that would yell at you if you get the front wheel too far off the ground, etc. I think there are all kinds of fun things to do. I know there are expensive and half solutions out there, but having an opensource solution would be nifty.
I'm a relative noob with C# and I'm using SharpDevelop. If anyone has any suggestions for things to implement or can help me acquire and use the GPS data I'd appreciate it.
If this sounds like a dumb idea I can always abandon it too.
Thanks guys.
lol, actually I think its a cool idea to be able to log what your doing. And maybe a top speed via the GPS. I think that would be a really cool app to have when I ride.
gliscameria said:
Hi all,
I'm relatively new to the WinMo programming, but so far I've been able to capture and process the Gsensor data, but I can't seem to understand how to use the GPS data.
I want an app that will record the GPS position along with all of the Gsensor data so that I can record the route and have data for each point that contains lean angle, acceleration, deceleration, etc. I figure I'll have to have the Gsensor fill in for some of the GPS data and vice-versa.
Why you ask?
Well, let's say you put it in a suspension test mode. You could accelerate gradually and brake. Hopefully the gsensor could catch the dive and bobble of the bike and give you some feedback. Knowing how far you are leaning in some turns is nice. You could possible detect and calculate if you are sliding at all. Perhaps you could even calculate the power output if you included the weight. You could make a mode that would yell at you if you get the front wheel too far off the ground, etc. I think there are all kinds of fun things to do. I know there are expensive and half solutions out there, but having an opensource solution would be nifty.
I'm a relative noob with C# and I'm using SharpDevelop. If anyone has any suggestions for things to implement or can help me acquire and use the GPS data I'd appreciate it.
If this sounds like a dumb idea I can always abandon it too.
Thanks guys.
Click to expand...
Click to collapse
I don't think its a "practical" idea, not dumb, but for learning how to code and stuff, its a great idea. I'm assuming you enjoy riding at the track, so that'd keep you motivated to continue the app development.
There are already similar apps, but I don't know if they will detect lean angle and brake dive.
That's the first thing I thought of when I saw this app:
http://forum.xda-developers.com/showthread.php?t=424423
I haven't played with it, but maybe it could give you something to start with.
Check this out too
http://www.racechrono.com/
The newest SpeedoHealer has a top speed recall on it, and its only $100 for the whole system. Much less than having to buy a WM phone just to record top speeds.
Most of us need one of those anyway, but if you could make your app work in conjunction with that system.. could be very useful.
Especially for the initial calibration. Get the correct GPS speed from the phone, and then get on the SH website from the phone for the correct calibration code! Or find a way to integrate the SH code program thing into your app. so you don't have to get online for the code. That would be very useful for gearing changes at bike nights when the dyno is unavailable.
But you could load some track maps in it, have the thing record acc/dec at which points at each corner. Then you could see where you started braking at, and decide if you need to brake sooner and softer, or later and harder.
Maybe if (lets hope not) you go down, you could see how much decel. at what angle caused the loss of control.
Think you could set it up to calibrate the 2 axis independantly?
set the side to side while on a stand, then remove the stand and calibrate the front to back when loaded with the rider at static sag, cuz its going to change from when its on the stand and the stand is the only way you're going to get anything close to accurate verticle calibration, but the front to back will be off with the back wheel raised.
Where you thinking of mounting the phone to the bar/tripple clamps?
or under the tail?
I think I'd be afraid of losing such an expensive piece of equipment if it was mounted upfront. But you can't see anything on the screen under the tail.
Unless you didn't want it to display anything, just collect data.
Not that you'd be able to do much screen touching with gloves on anyway.
Better use large buttons! lol
Do you think you could setup the light sensor to determine if a headlight bulb is getting old? I don't know if the sensor will work when flooded with that much direct light.
Well anyway, just a few ideas for ya.
I don't ride at the track, but I'd like to test the app out when you get a working beta going.
I'm sure it could have its uses on the street.
And I know the speedo is off on my 08 Busa.
KYT said:
Well anyway, just a few ideas for ya.
I don't ride at the track, but I'd like to test the app out when you get a working beta going.
I'm sure it could have its uses on the street.
And I know the speedo is off on my 08 Busa.
Click to expand...
Click to collapse
Thanks for the input. Until I can find some help on the GPS aspect of it I'm kinda idling.
I'm thinking...
When you start the app you will have to have it mounted and be on the bike. There will be a calibrate button which you will press when you are centered. From there on out you can pick a mode.
Your busa better not have any chrome on it. =/
Keep it up!
Very cool idea! I actually experimented with an analog 'curve counter' mounted to my motorcycle several years ago. Built a box with a steel ball inside that rode along a curved piece of metal and made contact closure with a terminal on each end - different viscosities of oil provided the dampening to keep it from bouncing around. This was coupled to an electronic counter that I built from a kit. It was kinda cool, but a pain to get mounted.
I don't have the experience to lend for application development, but I would certainly be willing to test any versions of the app you would like.
FYI - right now I use Run.GPS for tracking but would love to have lean angle and acceleration/deceleration data to go along with it. The only glitch with lean angle is that I assume the centrifugal force during cornering would prevent the accelerometer from reading the true lean angle...maybe some calculations could compensate.
go for it!
my hayabusa, my tp2 and I would be happy to be in your test team ;-)
and BTW, I am a veteran C# developer, so let me know if I can help.
(experienced in C#, but not in Win-Mo or HTC hardware)

[Q] Wonky Proximity Sensor?

Hey guys,
I've bought a slightly used myTouch 4G off of Craigslist to replace my Vibrant.
I've rooted and modded the MT4G and I'm currently running CM 7.2 RC0. I followed the step-by-step directions from the CM Wiki.
I've found what I think is a problematic proximity sensor reading. Every time I place or receive a phone call, the screen blanks out. The only way I've found to bring the device back, is to wait for the phone call to disconnect and then receive another incoming call. This _usually_ will reactivate the display. As long as I don't answer that phone call, the display will remain active.
I downloaded a proximity sensor app off of the market and according to the app the proximity sensor is engaged 100% of the time (which explains the behavior a little bit). But I don't know whether or not to trust this app.
I've tried tinkering with every proximity setting I can find, both in the phone's settings and in the extra settings that CM ships with.
Edit: I'm sorry for not mentioning it earlier, but I have done a bit of research on the proximity sensor. I don't think there's any kind of screen protector that might be obscuring the sensor.
What are the chances that the phone's proximity sensor is damaged? Is there any way to spoof that value and override what the sensor is repeating back to the OS?
Does anyone have any helpful suggestions?
For what it's worth, here's some information from About Phone:
Android Version: 2.3.7
Baseband Version: 12.28b.60.140eU_26.03.02.26_M
Kernel Version: 2.6.35.14-cyanogenmod-g295e82f [email protected] #1
Mod Version: CyanogenMod-7.2.0-RC0-glacier-KANG
Build Number: GWK74
Thanks in advance for taking a look
Are you using a case? My wife bought a cheap case that covered the prox sensor and it behaved exactly how you said.
Edit: I found an app in the market called Hardware Disabler. It scans your device for drivers and disables whatever you select. The problem is it only gives you the driver's name, not what it works for. If you can identify the driver (perhaps a knowledgable dev could help) you could kill that baby on startup.
Sent from my HTC Glacier using XDA App
Yeah, sorry I didn't mention it before. I've got nothing that I can think of that would be interfering with the proximity sensor on the front of the phone; no screen protector, no little case. Nothing at all.
Tonight I've been monkeying around with a few different things, just to see if I got better/different results:
Tried a couple of the different/newer radios from the radios post in the dev forum.
Wiped cache and Davlik partition
Reset phone back to factory defaults.
Flashed back to one of the T-Mobile Froyo ROMs.
None of these helped, but on a lark. I decided to go ahead and shine a big flash light at the phone while I was running the Proximity Sensor Finder application. If I shined the light directly on the proximity sensor, then the proximity sensor would intermittently blink on/off.
It doesn't really help me all that much, but it looks like I definitely have a flaky/bad proximity sensor.
In order to help people down the road who might have the same problem, here's some things I'm going to try:
Deny permissions to the device's file in the /dev directory
Try and use an app like Tasker to disable the sensor.
May flash MIUI, it sounds like it has an option to permanently disable the proximity sensor.
An app on the market called Proximity Screen Off
I'll keep the thread up-to-date with what I wound up doing. It's a bit of a bummer, I got this phone to last me until my contract expires with T-Mobile in a few months. But it was hopefully going to be a definite upgrade over the Vibrant. It's a little aggravating that I'm going to spend the next few months heating the side of my face when I'm on the phone and/or accidentally hanging up on people when on the phone
Last reply to my own thread, I promise. The MIUI's disable proximity sensor setting worked great, although I wasn't really crazy about the look & feel of MIUI (this isn't a dig on the ROM, just a personal preference).
We wound up using a Hex Editor to edit the file /system/lib/hw/sensors.glacier.so, we searched for "cm3602" (the proximity sensor) and changed it to "xxxxxx".
The one downside is the phone doesn't turn off when you hold it up to your face, but that's certainly better than a phone who's display likes to power off when placing/receiving phone calls.
Thanks for comments mines also have this issue too.
Sent from my HTC Glacier using XDA App
Nice thread Neckhole. I'm glad you followed up on this and let us know what did and did not work for you. Thanks. I really hate it when people figure something out and never post it. Ha.
Sent from my HTC Glacier using XDA App
estallings15 said:
Nice thread Neckhole. I'm glad you followed up on this and let us know what did and did not work for you. Thanks. I really hate it when people figure something out and never post it. Ha.
Me too lol
Sent from my HTC Glacier using XDA App
Click to expand...
Click to collapse
Sent from my HTC Glacier using XDA App
I'm glad what I found out has helped you guys too, I posted a blog about it too after a few people found it to be helpful.
MyTouch 4G: Don't Stand So Close to Me
Just a quick update, I've been re-flashing different ROMs and had to re-make this change. Which helped me spot some typos in my blog post (woops) and I took the time to write something more close to step-by-step instructions. Hope this is more helpful:
http://blog.brianmoses.net/2012/01/mytouch-4g-dont-stand-so-close-to-me.html
Get ADB Functioning on your desktop computer.
Download and install a Hex Editor
Use ADB to pull down the file sensors.glacier.so (adb pull /system/lib/hw/sensors.glacier.so)
Open sensors.glacier.so in your Hex Editor
Search for the text "cm3602" (no double-quotes) and save your changes. Please note, case sensitivity is important. If you're paranoid, it's good to check that the file size is exactly the same as it was before your edit.
Re-mount the /System folder as read-write using an ADB Shell (mount -o remount,rw /dev/block/mmcblk0p25 /system)
Open up a new command window and use ADB to push your edited file (adb push sensors.glacier.so /system/lib/hw/sensors.glacier.so)
Reboot your phone.
For whatever it's worth, I flashed my first ICS ROM a week or two ago. I totally forgot about my defective Proximity Sensor.
I thought people might like to know that the same steps I used to disable the proximity sensor previously still works in ICS.
thank you thank you thank you for this thread, i have the exact same problem i couldnt answer calls cause i use gv and i cant call where i have to press a number aftewards!
so glad it still works for ics. thank you again! posted this problem in a few forums no one could help
I have a doubt
You said : Search for the text "cm3602" (no double-quotes) and save your changes
what changes should I save? since all I've done is search for a text.
tripi24 said:
You said : Search for the text "cm3602" (no double-quotes) and save your changes
what changes should I save? since all I've done is search for a text.
Click to expand...
Click to collapse
Change cm3602 with xxxxxx
Thanks for this post. It has been a big help. I was having the same issues.
Did this work for anyone else? It did not for my phone. The phone goes black and can't access the dial pad.
I have the exact same problem after recently i replaced my broken digitizer touch screen & LCD.
I just realized that during the call , when the display goes totally black , if i push the UP-LEFT corner of the screen of my phone (just beside the proximity sensor) , the screen comes back again.
That's because the "adhesive" i used under the lcd screen , is more thicker than the original adhesive.
So the sensor is ok , the distant between the "touch & LCD " and the sensor is the problem.
Oh je baby pussyy
Shaggadelic baby
albi159 said:
Oh je baby pussyy
Shaggadelic baby
Click to expand...
Click to collapse
What?
Solved
Well i again diss-assembled the whole phone , and replace the thick adhesive under the Lcd & touch with proper one.
and problem solved as i guessed it's not from the Proximity sensor . no more dark screen

Categories

Resources