Is bcdDevice relevant for an Android USB driver? - Android Software Development

Apparently, somewhere in the process of rooting and installing CyanogenMod, the bcdDevice on my N1 changed from 0x0100 to 0x226 (or just 2.26 as reported by lsusb -v). I don't know why, exactly, and I don't really care.
(note: bcdDevice is different from bcdUSB, which marks USB version compatibility)
But this also broke it's support with the Android device driver for calibre, an excellent ebook management program, which uses a python based device driver to match USB devices for compatibility.
As I later found out, the Android driver in calibre matches USB devices for vendor id, product id, and bcdDevice. While it's a simple enough matter to get the developer to add 0x226 to the list for the next version, and even to tweak my own driver, I can't see that it matters to even have bcdDevice in the mix for Android.
I went back and forth with the developer, Kovid Goyal, who is amazingly helpful, not to mention patient, and puts an absolute ton of work into calibre.
He's convinced that bcdDevice is necessary, because maybe the custom rom that changed it won't be compatible. For something like a dedicated ereader I can see his point, but for an Android device I don't see that it matters.
But I'm just a fledgling Android user, and not an experienced developer.
I did manage to customize the calibre driver to not match for bcdDevice, but only using a less than ideal method. It's working fine, but who knows, maybe Mr. Goyal is right and in the future it will cause problems.
So I'll ask the greater Android development community: Is vendor and product id sufficient for something like this, or is bcdDevice really necessary?
For reference, there's the thread in the calibre forums that I discussed this back and forth with the developer in:
http://www.mobileread.com/forums/showthread.php?t=73743

Related

Someone to write a program

I know this is for programmers only but since I am looking for a programmer I figured it would be okay for me to post this here.
MODS - If it belongs someone else then please feel free to move it...
I own a HTC Universal (Cingular 8125) and I am also a diver. For a few years I looked at various Palm based dive logging software (when I had a Palm) but never bought one because I like to write longish descriptions of the dive and didn't want to do that in Graffiti or bring both a Palm and a portable keyboard on a dive trip. The desire to minimize electronic gadgets (and weight) is also why I never bring a laptop along with me. However, with the 8125 I have one device that I can bring with that lets me watch movies on the plane, listen to music on the beach, check my e-mail if I find find a wifi hotspot, and has the full keyboard and can use as a phone since it is GSM!
That being said, most dive comptures have the capacity to download information about the dive (depth, temperature, etc) to a computer. This information is very useful when you combine it with a log since it allows you to see what is called your dive profile and if you have the right logging software you can then combie this profile with your comments and create a really neat electronic log book.
However, the logging software for my computer, and I believe most computers, will not download to my device to any device running WM5. I had pretty much given up and figured I would have to wait awhile until these silly companies ralized there was a demand for WM5 and hopfully created software so you could download your computer information directly into your phone. However I recently found this device http://reefnet.ca/products/sensus/ which is very different. It is more of a logger than a dive comuter in that you do not interact with it during the dive and it does not give you any guidance about dive limits. One of the biggest things that makes it different is that they, "realizes the benefits of publishing the technical details of its data recording devices. If you're a software developer, dive organization, or just curious, you may download our free Developer's Guides. In them we carefully detail everything you need to know to be able to download data from Sensus recorders. The Sensus Ultra Developer's Guide is AVAILABLE NOW!"
So what I was thinking is that someone might be able to create software for WM5 so that we could download the information directly into a Pocket PC. This could then perhaps be combined with a program like this
http://blackwave.com/products/DiveAssistantPocketPC/index.aspx or this http://www.dreamdives.org/en/products/products1.htm to create the full package.
I think this would be a killer app that could make someone a few bucks. All I would ask for would be a free copy. I will even do the testing for free. the only big hurdle that I know of, and why they currently do not support download to WM5 is that the downloader uses serial ports.
Here is the link to their developers guide
https://secure.reefnet.ca/downloads/public/doc/sensus_devguide_ultra.pdf
If any one has any questions please feel free to PM or e-mail directly at bigcatdiving at gmail dot com
dcdivenut: why do they sell Palm software? What does the Palm software do? Presumably it doesn't link directly to the logger? Although, IIRC, the Palm does have a kind of serial port built in.
Your biggest hurdle here clearly is the physical lack of a serial port.
Basically you've got a logger, and want to connect it to the phone? Converting the data into a universal format should be straight forward, most logging is done in clear and easy to manipulate text.
So, how do you get around the hardware limitation? You could wire together a serial to IRDA converter and blast the logs directly into the infra red port. But is that the kind of thing you want or need?
V
Or you could use a bluetooth to serial converter. It may actually be more stable and easier to use than IrDA.
J-Man5
vijay555 said:
dcdivenut: why do they sell Palm software? What does the Palm software do? Presumably it doesn't link directly to the logger? Although, IIRC, the Palm does have a kind of serial port built in.
Your biggest hurdle here clearly is the physical lack of a serial port.
Basically you've got a logger, and want to connect it to the phone? Converting the data into a universal format should be straight forward, most logging is done in clear and easy to manipulate text.
So, how do you get around the hardware limitation? You could wire together a serial to IRDA converter and blast the logs directly into the infra red port. But is that the kind of thing you want or need?
V
Click to expand...
Click to collapse
I !think! the palm software allows you to download directly to the Palm via the serial port.
As far as an infrared port to get the data into the PC that is more or less exactly what I am looking for. Here is a long discussion on a scuba forum that involves a programmer from the company that might gove some additional information.
http://scubaboard.com/showthread.php?t=140213&highlight=sensus+ultra
I guess there are two challenges
1. Getting the data from the logger to the device either via some sort of serial/USB converter or serial/IRDA converter. I found this out there which would "seem" to work http://www.usbgear.com/IR-210S.html
2. Then having a program to take that data and with a decent GUI turn it into something displayable a la the palm and windows software on their website. Then possibly taking it a step further and integrating that into "dive log" software so that in addition to the profile information gathered from the logger you can record where you were, who you were with, what you saw, what equipment you had, etc. a la the blackwave or sharkpoint software.
Why not try styletap to run the palm software on the pocketpc windows mobile?
J-Man5

What do you use to develop with?

I have been trying to learn how to do some android development for work and keep running into problems. I find it hard to believe that people are able to create a lot of these apps with the Google development tools in such poor condition.
I have set up a development system with eclipse and the android tools. One of the first problems I ran into is ADB crashing whenever I tried to debug and there was a device attached to the system. Didn't matter if I was trying to debug on the device or emulator, ADB would crash. I was finally able to get the problem fixed by using the Composite ADB interface driver instead of the plain ADB interface (would it really hurt Google to add one sentence to the directions to tell people this?)
Now every time I go to debug, the emulator comes up in Chinese/Japaneses. I type in English and it converts it. I can fix it by changing the input method, but I have to do it every time I start the emulator. I have Googled looking for a solution and have found this is a known problem that has been around for almost a year and there is no resolution with it. The bug reports I have found on the android site even lists them still as NEW!
When trying to debug a problem, I wanted to delete the shared preference file for the app as it seems like it had become corrupted and every time it went to read it, the app would force close. (And when this happen, the debugger perspective would come up but for the life of me, I could not find any information as to what caused the fault or any sort of stack trace to look back and see where in my code it failed).
If you are an app developer, are you running into these issues? Have you found ways to work around the problems? I just can't believe that this is the way people develop for this platform. I'm ready to tell my boss that we forget about the platform unless we can find some stable development tools, otherwise we will be spending more time fighting with the tools than working on the app.
If anyone has any suggestions, I would really like to hear them. I'm not a noob when it comes to software development (20+ years as a software engineer), but I have never seen development tools for such a major platform, be this poorly done. What am I missing?
I'm a professional developer as well too. 20 years or so as a C/C++ developer, but I've worked most of my career as a Unix developer. Naturally, I use linux where possible and my Eclipse setup on Gentoo linux is pretty stable. I tried on Win7-64 but it was buggy as heck. I believe that the problem is with Java. There seems to be so many ways to set it up wrong that I'm not sure you can set it up right under windows.
I find it ironic that Oracle is trying to sue Google for making a JVM that actually works!
I havent had any of your mentioned issues. I am running eclipse on a 32 vista machine and a 64 bit windows 7 machine.
Not sure what I may have done different that you for setup. But I followed the Android application development for dummies book. The author goes step by step of what to download and how to install and configure. Even though your software experience is way beyond this book maybe its worth picking it up to read the install notes.
FreeTheWorld said:
I havent had any of your mentioned issues. I am running eclipse on a 32 vista machine and a 64 bit windows 7 machine.
Not sure what I may have done different that you for setup. But I followed the Android application development for dummies book. The author goes step by step of what to download and how to install and configure. Even though your software experience is way beyond this book maybe its worth picking it up to read the install notes.
Click to expand...
Click to collapse
I picked up the book, "Sams Teach Yourself Android Application Development in 24 Hours" and it has a section for setting up the environment too. Followed it to the letter several times and always had this problems. I think the issue comes down to the books were written using version 6 and 7 of the SDK and the current version, 8, has introduced some problems the books don't cover. For example, the tools directory has been split into two directories, tools and platform-tools. When you first download the SDK, you don't get everything you had like before until you update the SDK.
I have talked to several other people who also had the problem with the ADB crashing like I did, even started a thread here about it. No one could get any help anywhere on resolving the issue. I think the problems I have that others don't see is because they started with an earlier version of the SDK.
Gene Poole said:
I'm a professional developer as well too. 20 years or so as a C/C++ developer, but I've worked most of my career as a Unix developer. Naturally, I use linux where possible and my Eclipse setup on Gentoo linux is pretty stable. I tried on Win7-64 but it was buggy as heck. I believe that the problem is with Java. There seems to be so many ways to set it up wrong that I'm not sure you can set it up right under windows.
I find it ironic that Oracle is trying to sue Google for making a JVM that actually works!
Click to expand...
Click to collapse
I have also setup the development platform on a linux system and haven't had the problems I have with Windows 7 64bit. I also feel a lot of the problems have come from the Windows 64bit platform and even windows in general. I tried installing on a clean 64bit and 32bit Windows 7 and was still having the ADB problem. As soon as I get my tax refunds, I'm going to get a work desk setup at home so I can try using my linux system (it sits on the floor with no monitor and is my network server). Boss will really love it if I tell him we have to set up linux platforms to develop on. Guy is a bit of a tight wad when it comes to equipment.
edboston said:
If you are an app developer, are you running into these issues?
Click to expand...
Click to collapse
Nope, I didn't have any stability problems with SDK. I use linux 32-bit, didn't try to work on a Windows, MacOS and/or 64-bit arch.
I've not seen any of your problems, either.
FYI, I followed these instructions to set up the env:
http://developer.android.com/resources/tutorials/hello-world.html
(Environment - WinXP/32 netbook)
Eclipse is buggy. The most annoying issue with it is that the auto complete freezes your computer at times.
An alternative is IntelliJ. They offer a free community addition. I work with one dev that swears by it.
I use Windows7x64 and Ubuntu 10.10 to develop my apps. I use IntelliJ mostly because I find Eclipse to be convoluted overcomplicated mess. I think the Android integration in Eclipse is better, especially around editing some of the key XML files but I despise how projects are organized in Eclipse.
The OS you use really doesn't matter the results are the same, once you're up and running the work will be the same so the OS becomes irrelevant. The IDE becomes the differentiator.
I haven't met with the issues you mentioned, but as you said it can be because I installed the sdk a long time ago (after google anounced the eclair). I'm using eclipse and yes, that program is full of bugs, but I read an article about developing for android in Netbeans (my personal favorite). You can read it here: http://androidportal.hu/2011-01-09/fejlesztes-androidra-netbeans-segitsegevel (it's hungarian, but google translate is our friend)
Sent from my GT-I5700 using XDA App
MotoDev Studio 2.01
stick to 32-bit Galileo
for the slow autocomplete problem, I've made sure to use eclipse Galileo, something in Helios was causing massive lag. Also make sure you're running the 32-bit version of eclipse, even if your machine is 64-bit, there are definitely some bugs last time I tried to install ADT on 64-bit eclipse.
the new tools directory was a bit of a pain after updating to the latest API but nothing too bad once you figured it out.
I haven't had many of the other problems you mentioned. I always debug with adb logcat from terminal, and you can always hop into the device with adb shell.
I use eclipse every day at work so I've kind of gotten used to all the little quirks. I had the chinese text problem with the emulator, but I do most of my testing on a real phone. I use the emulator just to try out different resolutions.

Job opportunity for Software Dev...

SpectraCal, a leading company in the video monitor calibration business, is looking for software developers that can take their existing Windows based calibration software and either port it over to Android or create a similar experience for tablet users.
Calibration software utilizes a USB connected devices called Colorimeters, Spectroradiometers, or more commonly referred to as "Probes".
Not only would you need to be able to write the program to run on tablets, but you would have to be able to create drivers to connect these USB devices to work with the software...now that most tabs have USB (screw the iPad)
I am in no way affiliated with SpectraCal, and only learned of their desire when asking them about Android support. I am a user of the Windows based application called Calman, and I am in the market for a tablet to replace my laptop, which is only used for web based stuff, BUT ALSO CALIBRATION...My only choices so far are the few Win7 based tablets coming out, but would much rather have an Android based tablet that I can use for calibration as well.
The company's website is http://spectracal.com and the contact for anyone who is interested is L.A. Heberlein, [email protected].

Wine on android x86?

So, as I've been thinking about Intel's announcements about medfield atom powered android devices, and the pre-existing android x86 project. I've previously asked the question if you could load windows 7/8 onto an android x86 device, and the answer was, pretty much yes, as long as there are drivers. But running windows isn't that great of an option for a mobile device, so i dug around and saw WINE, which i had forgotten about. From what i've learned, it requires X11 library support on the OS for windows programs to run. Android does not support X11, which stops WINE from being able to run on android X86. Now, with android (and, apparently X) being open source, surely there's a way to build enough of it into android so that WINE can run? One of, say, the x86 android tablets intel and motorola agreed to make would be amazing if a custom ROM could be created to be able to have some support for X, and therefore run WINE.
Now, i'm no dev so i have no idea how difficult (or not) this would be, but it seems completely possible, and it also seems like a much preferable alternative to any metro-haters.
(and yes, i've seen this, i consider it worthless to run an emulator in an alternate OS on a phone. i'm looking for native support.)
Please, don't troll, flame, report, or anything else i know you all love to do. I just wondered if this actually is possible - seems like it should be - and what work would have to go into it to get it to work.
thanks to anyone who can help answer!

How Microsoft thanked netham45 for the exploit

My father was at the Microsoft HQ for 2 weeks, he sent me a text from there : "Félicité par ms..." ("Congratulated by Microsoft..."), we were talking about the exploit at this moment. This morning, he came back home after a long sleepy flight. Just ten minutes ago, he told me about how Microsoft "thanked" the exploit.
Mark Russinovich, co-founder of sysinternals (Acquired then by MS), made a demo on how to change the color of the bluescreen on a Surface. Using the kernel debugger, he first triggered a bluescreen to see where was the bluescreen display code located inside the kernel. After that, he seeked for the color code (My father didn't remember how) and asked the audience for what color they wanted instead of blue, a man answered pink. Then he made an unsigned driver that would change the code color inside the kernel hex/assembly (I don't know if he had access to the PDB for this exploit), and, thanks to the exploit, he installed the driver. Finally, he triggered a bluescreen that was actually a pinkscreen.
This demo couldn't have been possible without Netham's jailbreak, and Microsoft looks actually very grateful to him. This makes me think that the Surface is kind of a Kinect-like product. The Kinect has been hacked 3 hours after its commercialization, and Microsoft didn't fix it. They even published an SDK so devs can use it on PC for whatever they want. The Surface remembers me that case, and I think they actually waited for a jailbreak to be released.
Thanks Netham for this jailbreak.
Cool though that sounds... there are a few important points here.
0. Netham45 publishes a nice tool, but it's not really his exploit. The research that produced the jailbreak hack in its basic form was performed by another XDA-Devs member, clrokr.
1. Odd that you mention a kernel debugger. Clrokr's exploit, as published, doesn't enable kernel debugging. That's blocked by Secure Boot policies which aren't affected by this hack.
2. If Microsoft wants to enable a kernel debugger, they can do that easily without any external help. For that matter, it's known that development devices (i.e. non-production-models) come with a much less-restricted bootloader; it's not as if MS developed Windows RT or the drivers for various devices without having a kernel debugger already!
3. Similar to #2, if Microsoft wants to run arbitrary user-mode code on Windows RT outside of an AppContainter sandbox, they can do that already via three different methods: either enable TestSigning mode and install their own certificates (we can't do this due to Secure Boot, same as kernel debug block), sign the binaries with their own trusted keys (obviously they can do this, or none of the Windows RT desktop mode software would run!), or simply change the signature enforcement check in the kernel and re-compile it (it's just a flag they can set; Windows on x86 has the same flag but it defaults to no enforcement for user-mode code and they could change that on RT easily).
4. Going back to #1, the current exploit is for user-mode code. So far as I know, it doesn't enable installing custom drivers either. Again, that's probably done either by enabling Testsigning mode (on a non-secure-boot-locked system) or removing the signature enforcement entirely in a custom Windows RT build.
That said, whatever the oddities in your story, I hope this works out like you describe. I personally think MS shot themselves in the foot with the restrictions of RT, and I hope they come to their senses about it. I've actually met Russinovich, and he's a very cool dude. He doesn't strike me at all as the sort of person to support a lock-the-user-out-of-their-own-system policy like RT currently has. Unfortunately, his position at MS (Technical Fellow) is has influence but isn't actually managerial; if the people in charge of the RT project demand that the jailbreak be blocked, it will be and Mark might have very little to do with the decision.
He can't remember all the details. My father works on PDW not debugging, and the debugging tools Marc used are from Sysinternals as far as I remember. But yes the details may not be accurate.
Mark might have very little to do with the decision
Click to expand...
Click to collapse
Doesn't it sound like "politically incorrect" to make this kind of hack on a Surface if that goes against the opinion of the company ? I know Microsoft doesn't keep an eye on every single demonstration from their employees but that would sound odd if MS finally fixes it. It is true that they lock their Xbox products as hard as they can, but there is commercial argument in the case of the Surface. Official developers will still develop Metro apps if they want to aim at WinRT users.

Categories

Resources