Android :: Modify Python USB Device Driver To Only Use Vendor_id And Product_id - Excluding BCD
Mar 27, 2010
I'm trying to modify the Android device driver for calibre (an e-book management program) so that it identifies devices by only vendor id and product id, and excludes BCD.
The driver is a fairly simply python plugin, and is currently set up to use all three numbers, but apparently, when Android devices use custom Android builds (ie CyanogenMod for the Nexus One), it changes the BCD so calibre stops recognizing it.
The current code looks like this, with a simple list of vendor id's, that then have allowed product id's and BCD's with them:
CODE:..........
The line I'm specifically trying to change is:
CODE:............
Which is, the line for identifying a Nexus One. My N1, running CyanogenMod 5.0.5, has the BCD 0x226, and rather than just adding it to the list, I'd prefer to eliminate the BCD from the recognition process, so that any device with vendor id 0x18d1 and product id 0x4e11 or 0x4e12 would be recognized. The custom Android rom doesn't change enough for the specifics to matter.
The syntax seems to require the BCD in brackets.
How can I edit this so that it matches anything in that field?
View 1 Replies
Nov 19, 2012
How can i get device information from nonrooted device with python script? As I understand python don't have API like os.android.build in Java.
I need to get system information from device, such as cpu frequencies, gpu vendor and other (like in Antutu and another benchmarks).
I know how to write python script with $getprop information from shell, and from buil.prop file in the system files, but it isn't enough. I also know how to get these information with shell command and busybox installed, but I shouldn't root them.
View 1 Replies
View Related
Jul 25, 2010
Is there any sample code or documentation on writing a driver for a USB device connected to the phone? Any suggestions would be greatly appreciated. Regards Dave
View 2 Replies
View Related
Apr 7, 2010
I've already installed the drivers and adb,but adb shell shows no device.The 2nd LG USB Modem installed as an Android Phone.I'm using winXP,SP2 PRO, these are my steps.enable USB Debugging mode,dial 3845....and enable root permission,restart my phone,connect my phone to PC,install the drivers.win+R TO open CMD window,cd to the sdk tools directory,adb shell,shows device not found in my device manager,there's an android phone class,under it is an android Adb.
View 4 Replies
View Related
Apr 18, 2010
I know ADB was working before I updated to 2.1 root. Looking at the USB devices the current driver isn't compatible with the phone now. Is there a change I need to make to get the USB driver to work? Yes I have USB debugging on.
View 4 Replies
View Related
May 14, 2010
Device driver failed to install
View 10 Replies
View Related
May 29, 2012
Where I can get the device driver for the Ampe A10 10.1" tablet.
Windows 7 x64 detects a device called "Android" when you connect the tablet and says no driver found.
The tablet does not appear on the device chooser in the eclipse development environment.
View 2 Replies
View Related
Apr 19, 2010
No matter how many times I reinstall the device drivers, they all install correctly besides the Android ADB Device driver.
View 4 Replies
View Related
Nov 10, 2009
I ran into the first problem with my Droid- and I am sure it is not the Droid itself. I am running Vista32- I have Motorola Media Link installed. When I plug my Droid into the PC, I get a mass storage device that installs OK most of the time, and an "unknown device".. Even when I mount the SD from the phone, I still see no Drive in my computer The unknown device never installs. I have tried almost every suggestion i have seen.. reboot pc..reinstall MML, reboot phone.. no luck
View 6 Replies
View Related
Aug 31, 2010
Does anyone know where I can get the bluetooth peripheral device driver for the X?
View 1 Replies
View Related
Dec 14, 2009
Does anyone submit source code into Android code? Is there limitation to someone that sumbit? How to do this procedure? (I would like to submit device driver into Android kernel source code)
View 3 Replies
View Related
Apr 27, 2012
My problem is my car radio that has earlier been paired with my sgs2, now keeps asking for pairring everytime i connect my phone to my parrot. Is there some way to exclude the mac of the radio so it is just denied parring for good. It keeps trying 4-5 times and it is starting to annoy me
There is no way to turn off BT on my radio (made in china )
View 1 Replies
View Related
Apr 16, 2012
How can we put a negative filter on Titanium Backup so that it excludes specific apps instead of selecting for it (as does the default positive filter)?
For example, I want to exclude Seek Droid from TB's "Backup New Apps" schedule, so that I will back up everything that's been recently installed, but not Seek Droid.
View 9 Replies
View Related
May 27, 2010
In case anyone else is having problems getting their Incredible to connect, the easiest way I found to install the USB drivers are with the HTC sync program here:
http://member.america.htc.com/download/Driver/DROID_INCREDIBLE_Verizon/HTC_Sync_2.0.33.exe
The google SDK driver doesn't yet work with the Incredible, and though it can be hacked - this download might be easier for some.
View 3 Replies
View Related
Nov 8, 2009
Hey I've been playing with my droid and I was wonder whether there are any scripting apps. Something like python on the phone? Is it possible? Is there anything like that?
View 4 Replies
View Related
Nov 15, 2010
I have installed python environment using python_for_android_r1.apk file. While installing, it installed some other 'extra packages' also so almost 8 - 10 MB files are instralled looks like. I got an icon in my applications, as "Python for Android". But now when I try to execute this by clicking on this icon, it gives a blank screen with a button with a text "Uninstall" . Not sure what else I need to do to get this work.
View 4 Replies
View Related
Jun 16, 2010
As the title ,I'm an absolutely newbie ,and I don't know how to get my milestone install some valuable linux software , for example ,MySQL ,Apache ,and so on. And ,there's any tool that I can use to operate remotely by linux command line on my lap top through usb or WIFI ? Or can I get some app running on mobile side can using linux commands?
View 6 Replies
View Related
Mar 11, 2010
I am porting a Python application to Android and, at some point, this application has to communicate with a Web Service, sending it compressed data. In order to do that it uses the next method:
def stuff(self, data): "Convert into UTF-8 and compress."
return zlib.compress(simplejson.dumps(data))
I am using the next method to try to emulate this behavior in Android:
private String compressString(String stringToCompress) { Log.i(TAG, "Compressing String " + stringToCompress);
byte[] input = stringToCompress.getBytes();
// Create the compressor with highest level of compression Deflater compressor = new Deflater();
//compressor.setLevel(Deflater.BEST_COMPRESSION);
// Give the compressor the data to compress compressor.setInput(input); compressor.finish();
// Create an expandable byte array to hold the compressed data.
// You cannot use an array that's the same size as the orginal because
// there is no guarantee that the compressed data will be smaller than
// the uncompressed data.
ByteArrayOutputStream bos = new ByteArrayOutputStream(input.length);
// Compress the data byte[] buf = new byte[1024];
while (!compressor.finished()) { int count = compressor.deflate(buf);
bos.write(buf, 0, count); } try { bos.close();
} catch (IOException e) { } // Get the compressed data byte[] compressedData = bos.toByteArray();
Log.i(TAG, "Finished to compress string " + stringToCompress);
return new String(compressedData);
}
But the HTTP response from the server is not correct and I guess it is because the result of the compression in Java is not the same as the one in Python. I ran a little test compressing "a" both with zlib.compress and deflate.
Python, zlib.compress() -> x%9CSJT%02%00%01M%00%A6
Android, Deflater.deflate -> H%EF%BF%BDK%04%00%00b%00b
How should I compress the data in Android to obtain the same value of zlib.compress() in Python?
View 2 Replies
View Related
Feb 10, 2010
I learned that the Android Scripting Environment (ASE) supports python code. Can I take my existing python programs and run them on android? Apart from the GUI, what else will I need to adapt? How can I find the list of supported python libraries for ASE?
View 1 Replies
View Related
Apr 29, 2010
I want to install a python package from source on android. Is this possible? I tried in the console to run the py install files, but disturbing (.core, ccompiler) isn't being found. Is it possible to still install them?
View 2 Replies
View Related
Jul 27, 2010
I just ordered an Android smartphone and want to start playing around with creating my own applications. Now the question is which language to use, the native Java or Python using SL4A (former ASE).
I tend to Python, as I know it much better than Java, but I'm wondering what I would be missing using a "second class" language on Android. On the SL4A website it is also stated to be alpha quality software, which is not exactly encouraging.
I'm also not quite sure what the limitations of the scripting environment are and if they would be problematic.
View 3 Replies
View Related
Aug 25, 2009
This link says that Android support Python, Lua and BeanShell Scripts, subsequently for Perl too. If it is so, is it possible for developers to write python scripts and call them in their standard Java based android applications?
View 2 Replies
View Related
Jan 16, 2010
Here's my Python script written using android-scripting:
CODE:............
while True:
CODE:.............
It basically vibrates every minute (like a motivator). However, when the phone is locked with screen blanked out, I don't sense any vibration. Perhaps Android is freezing the script (and hence the while loop)? Note that I am indeed running this script as a service (long-tap and click 'Start as service').
Is there a way to make this script work all the time regardless of the phone suspend state?
Update 1: I do hear the vibration occasionally, not every minute .. but rather like every 5-10 minutes randomly.
Update 2: This problems occurs if I run the script normally (not as a service). Seems like "time.sleep" is not sleeping for the specified time.
View 4 Replies
View Related
Aug 18, 2009
Is it possible to evaluate a string of python code (or Perl) from Java when developing Android applications?
I am try to do something like evaluating a text-input script:
e.g.
CODE:...........
View 2 Replies
View Related
May 11, 2014
I've got a moto g and its my first android and its rooted and bootrom is unlocked, and ive installed terminal emulator, but I cant find out how to install python so that it works in terminal eit su, cd , ls ... commands?!?
I've installed qpython app from playstore but you cant do commands like su, cd ..... I've tried ping in terminal emulator and it works so you can enter internet over terminal emulator, so i tried apt-get install python but it says no apt-get command founder something like this, so how to install python on android with working commands( su ...) so that it can enter filesystem directories like /sdcard....
View 2 Replies
View Related
Jun 1, 2013
What I am trying to do is get either nest-api in PHP or pynest in python to run out of SL4A in order to control my Nest thermostat ultimately out of Tasker. Both are found on github, but I can't link to them as I apparently need ten posts to do so. So a google search for "nest-api github" and "pynest github" will have to do I suppose.
I have absolutely no issues getting either to run out of Terminal on my MacBook Air, but for whatever reading the SL4A shell seems to escape my understanding. I would rather have the PHP script work, as it has more options for things I can set, which I like. Where to put the nest.class.php on my phone in order for the PHP shell to reference it when running the example.php or any script I write myself. When I put both files in the sdcard/sl4a/scripts folder and try to run either from within either sl4a or sl4a's shell I get a call to undefined function error.
For the python script, I'm not sure how I need to import the module so that I can call it with nest.py at the beginning of my command line prompt and follow it up with the user name and password and so on. I've done everything including trying to create an .egg file, which I've since been told is not necessary, and that I simply have to put it in the /sl4a/scripts folder. That doesn't make sense to me though, as I needed to run the setup.py command on my computer in order to start using it, and the .egg file should be the equivalent of that on the phone, no?
So what I am looking for is the foolproof way to get either a php or python script running through the shell that isn't actually hooking into the Android environment at all, which is what all the writeups I have found in my searching seems to pertain to. Then eventually make sure that they are available in a way that Tasker can call them. I should also note that all this has been done in an emulator through eclipse until this point, as I didn't want to go screwing around with my brand new Nexus 4's file structure until I had the best practice perfected.
View 2 Replies
View Related
Nov 15, 2010
Hello Everybody. For an application prototype I'm creating a simple user login. The Password of the user will then be hashed using sha224 and transferred to the back-end. The Problem I am facing right now is the following. The password that was stored in the DB (also hashed using sha224) seems to look a little different then the hash I am sending.
I use the following code to create the hashes.
CODE:..................
What now will be produced looks like this and I will post the two hashes directly underneath each other. (The first one is python and the second android)
CODE:.............
They are almost the same but the python hash has two 0s more. Do you guys have any idea why?
View 3 Replies
View Related
Jun 1, 2010
is it even possible to modify .apk, by adding additional class to .dex and re-packing with modified manifest.xml?I know there are tools such as baksmali / smali to disassemble / re-assemble given classes.dex from .apk, but not sure limitation what could be modified from there on? I'm trying to add additional activity, to modify starting launcher activity (may be from androidmanifest.xml) from original apk, then re-pack and sign to make complete single .apk all need to be done out of build time, no raw source or build structure visible, only .apk as input.
View 1 Replies
View Related
Feb 20, 2012
Im want to modify and run an OCR app on android.As per my research i found that the OCR engine needs an NDK access.
Hence i've started with trying basic ndk samples.But im unable to compile/run those samples too.
Im working on windows 7 64-bit.
My question is whether i need to use Cygwin to run the above ?
View 1 Replies
View Related
Jun 10, 2009
I frequently encounter this message when I try to update a table (to enter a proxy) in the database using adb shell. $ adb shell #sqlite3 / data/ data/ com. android.providers. settings/databases/ settings.db sqlite> SELECT * FROM secure; SQL error: not an error sqlite>
View 3 Replies
View Related