[APP][3.1+] USB Device Info v0.0.5 - Android Software Development

Description
Android 3.1 introduced USB host mode which allows the user to plug USB devices to your Android tablet in the same way as a Desktop PC and extend its functionality (if the tablet has the correct drivers of course).
This application will provide information about almost all currently plugged-in USB device (see below for more info about the 'almost').
Information includes:
The Device class
The USB device path
The Vendor ID (VID) and the Product ID (PID).
A List of all interfaces and their endpoints.
This application uses two different methods to collect information:
Android mode will use the native android USB API.
Linux mode will parse /sys/bus/usb/devices/.
Each mode (Android/Linux) will provide slightly different information. For example Android mode will give you more information about a device's endpoints and interfaces, while Linux mode will give more information about the device itself (serial number, how it identifies itself, etc.)
Notes
If you download the accompanying databases, the application will also be able to provide you with additional info such as the Vendor of the device (which is not necessarily the brand!), the vendor's logo and the product name.
The Vendor ID database is the one used by my "USB VEN/DEV Database" application. Updating in one application will also update the other.
As this application is using the default Android API some devices might not appear. USB Hubs (and devices connected to them) are invisible event though they seem to function properly, and mice seem to be filtered out of the provided list. I'm looking into ways to fix this.
Device Subclass resolution will be added in the next version.
I wrote this application as an exercise to explore fragments and the new USB host API. Hopefully it will be useful to someone else.
The database is parsed from: http://www.linux-usb.org/usb.ids
Changelog
v0.0.1 First public release
v0.0.2 Added Interface and Endpoint resolution
v0.0.3 Databases can now be downloaded.
v0.0.4 Now also parses /sys/bus/usb/devices/ for those pesky devices android hides. Added export.
v0.0.5 Added support for small screen devices. Bugfixes and stability improvements.
Permission Explanation
ACCESS_NETWORK_STATE: Used to check if the device is on-line and using which interface.
INTERNET: Used to go on-line and download the updated database.
WRITE_EXTERNAL_STORAGE: Used to write the database to the SD card.
Acknowledgements
All logos are the property of their respective owners
Licence
Licensed under the Apache Licence 2.0: http://www.apache.org/licenses/LICENSE-2.0.txt
Links
Market link: https://market.android.com/details?id=aws.apps.usbDeviceEnumerator
Webpage: http://aschillings.co.uk/html/usb_device_info.html
Github: https://github.com/alt236/USB-Device-Info---Android
Screenshots
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}

[reserved for later use]

Is it working on 3.0 because my market won't give me to download this app
Sent from my Folio 100 using Tapatalk

The official USB API only came into play at 3.1 so I am currently compiling against that.
On the other hand the folio has a USB port right? Let me see what I can do later today.

Yes it has. Thanks

Any chance you can check if '/sys/bus/usb/devices/' gets populated in the Folio?
Quick walk-though in case you are unfamiliar with Linux:
1. plug a usb stick in the folio
2. Download a terminal application (like android terminal emulator: https://market.android.com/details?id=jackpal.androidterm) and start it
3. enter 'cd /sys/bus/usb/devices/' without the quotes and press enter
4. enter 'ls' without the quotes and press enter
5. post back what you see
(you can also do this from an adb shell if you know how)
if in step 3 you get something like "can't cd to xxx" I'll have to think of something else.

ok, I'll try
Sent from my IDEOS S7 Slim using XDA App

v0.0.5 is out.
Added support for small screen devices (tested on Galaxy Nexus).
Bugfixes and stability improvements.

Related

[APP] micro-httpd (GET / POST / CGI support) cross-compiled to Android

Hello,
A while ago I've managed to cross-compile a basic web server, resulting in a native ARM executable (you can find it here) that allows any other device to connect to port 80 (or whatever) and browse the contents of the phone.
Easy to exchange photos at a cafeteria which has wifi and both phones are connected - for example. No need for an FTP client, slow bluetooth, and so on...
However, I wanted more and since webserver was only handling GET (no POST / no CGI), I've started looking for an alternative that did the job.
Below, you will find a native ARM executable of micro-httpd, a light weight web server that supports CGI.
Download
Use it at your own risk!
mini_httpd_1.19.arm.tar.gz
It supports .htpasswd files to restrict access to folders - and it comes also with its own utility htpasswd which manipulates the password files.
micro-httpd website: http://www.acme.com/software/mini_httpd/
micro-httpd configuration options: http://manpages.ubuntu.com/manpages/maverick/man8/mini-httpd.8.html
You can use almost any CGI interpreter you want, minus PHP. The PHP 4 Android (a native implementation of PHP) has only CLI (command line support) and even if you could change the PHP code of the scripts to output the missing headers. BUT! It also outputs debug messages that you cannot control, in the output of the script!
Those messages are are considered errors in HTTP / CGI.
The creators of PHP interpreter say that is only meant for Scripting Languages for Android (SL4A) which works with what they have. You can read more here: http://groups.google.com/group/php-for-android/browse_thread/thread/79d0b5f856189675?pli=1. This topic also mentions an alternative (CGI this time) from GroomDroid but that is also unstable.
Enter PERL!
I had good success with Perl 4 Android
I can how host a blog on my phone - I've set up a big tutorial on how to configure everything here Running native CGI scripts (perl) with micro-httpd on Android.
Result
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Next step would be to try out a file manager and test file upload, then go even deeper to see if I can access various phone details and offer a sort of management interface for them on the web.
Source code
You will find the source code and the license (free) on the tutorial website above.
Seems interesting !

[APP] iptraf 3.0.0 for Android (with APK Installer)

Introduction:
Here's the classic iptraf for Android!
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Installation:
You need to have a rooted phone and busybox installed on /system/xbin
You also need to have about 1Mb free on your /system partition.
Usage:
To use iptraf, you need to either have an SSH server on your phone (for example DroidSSHd) and connect using Putty from your PC, or you can use the Terminal Emulator (please see attached screenshots).
Any terminal emulator application should work, but iptraf requires at least 80×24 characters screen so for smaller screens you might need to reduce the font size a lot to make it fit.
The price is payed for the installer and the effort to have iptraf cross-compiled for Android, since iptraf is distributed under GPL license. Put in a different way, you are just buying me a beer for making it easier for you to have iptraf on your phone!
Filters:
If you decide to connect using SSH, the trouble is that iptraf will show the SSH traffic too – something that you might not want to have there constantly updating.
It would seem intuitive to create a filter which excludes SSH port from the traffic, but once you do that, iptraf will not show anything else; iptraf actually has an “implicit no-display” policy meaning that once you apply a filter (include / exclude) nothing else is displayed, even if the filter is Exclude mode. You will need to have an additional Include entry added to the filter (after the Exclusion entry taking care of the SSH port) where everything is 0 and all the ports have an Y next to them. Please check attached screenshots as an example on how the entries of the filter should look like.
Please do not forget to “Apply filter…” every time you change something in the filters. X saves the filter, Ctrl-X cancel the changes, but even if you press X, the filter is not yet applied unless you Apply the filter.
Download
Please donate by buying it from the Google Play :fingers-crossed:
Use it at your own risk!
IptrafInstaller.apk
Source code: https://code.google.com/p/iptraf-installer/
Could you please make the sources of the iptraf binary available?
(preferably on github)
1 Euro to download from Android Market? That sucks
M66B said:
Could you please make the sources of the iptraf binary available?
(preferably on github)
Click to expand...
Click to collapse
As soon as possible ... I am working on an updated version.
defim said:
1 Euro to download from Android Market? That sucks
Click to expand...
Click to collapse
Well, you can actually download for free from few posts above.
I'm to lazy to update app by manual download .apk

[NOROOT] [Win] Android Backup and Restore [v.1.2.0.6] 23/11/2014

Android Backup & Restore
V. 1.2.0.9 (23/11/2014)
a tool for Windows users from a whatever user
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
See all the screenshots!​
Hey ya! Have you ever known Android has its own backup and restore utility built-in? You can access it via ADB. Yeah, that boring command-line utility you always use in order to hack your device (that or fastboot). Well, I've made the bridge between the Android B&R system and you, Windows clicker user!
So, what's the thing? It's a simple tool that... well... allows you to do backups and use them to restore your device!
What do you need? Just a few things!
Enable the debug mode on Android (Settings -> [System] Developer options -> USB Debugging)
Note: On Android 4.2 and newer, Developer options is hidden by default. To make it available, go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options.
Install the ADB driver for your device, so that it appears as "Android Composite ADB Interface" under Control Panel's Device Manager
.Net 4.5 Framework installed
Download
Installer: My site | XDA Downloads
Sources: not yet public (maybe hosted on GitHub later).
Changelog
1.2.0.9:
- [AndroidLib] Now the application uses adb.exe directly from the application's folder, instead of copying the resource to a temp directory (this avoids permission denied exceptions on some computers causing startup crashes)
1.1.0.6:
- [AndroidLib] Fixed application not launching (or better: silently closing) if adb.exe was not in the PATH.
- Introduced self-updating feature with setup file
1.1:
- Now the list of packages to backup is generated automatically downloading the packages list and using AndroidQuery's service. It is sorted alphabetically. NOTE: it will take a little to load the first time, then it caches the results in a local file (packages.json).
- The new default backup filename is DeviceName-YYYY-MM-DD-HHmm.ab
1.0: initial release
Known bugs
the "System" option is disabled for now, as it causes the adb backup system to exit without doing the backup (on both rooted and non-rooted devices, tested on Nexus 4, Nexus 7 with Android 5.0). If you want to help, try executing adb backup -f MyBackup.ab -system -apk and tell me if you find a way to let it execute correctly.
Donations
Thank you very much
XDA:DevDB Information
[Win] Android Backup and Restore, Tool/Utility for all devices (see above for details)
Contributors
elegos
Version Information
Status: Testing
Created 2014-11-16
Last Updated 2014-11-21
Updated to version 1.1!
Hello folks!
I know you're not so much interested in this tool, but I'd like to let you know in any case I've released version 1.1.0.6.
CHANGELOG:
- [AndroidLib] Fixed application not launching (or better: silently closing) if adb.exe was not in the PATH.
- Introduced self-updating feature with setup file
Excellent tool.
Very thanks
I,ll test later
Version 1.2.0.6 is out!
Changelog:
1.2.0.9:
- [AndroidLib] Now the application uses adb.exe directly from the application's folder, instead of copying the resource to a temp directory (this avoids permission denied exceptions on some computers causing startup crashes)

[APP] Emulator-like location mocking (geo fix) for phones (open source)

MockGeoFix
MockGeoFix allows you to fake locations on the phone exactly the same as the emulator - that is click start in MockGeoFix, telnet to port 5554 and use "geo fix" and "geo nmea" commands. That's it!
Code:
telnet [B]my_phone_ip 5554[/B]
Trying my_phone_ip...
Connected to my_phone_ip.
Escape character is '^]'.
MockGeoFix: type 'help' for a list of commands
OK
[B]geo fix 50 50[/B]
OK
[B]geo nmea $GPRMC,081836,A,3751.65,S,14507.36,E,000.0,60.0,130998,011.3,E*51[/B]
OK
Features
geo fix and geo nmea commands work just like with the emulator!
overrides OOM/low-memory killer priority so MockGeoFix never gets killed by the OS (requires root)
runs as a foreground service (optional)
support for Android from Gingerbread to Nougat
open-source
APKs direct download
In Google Play
Why
Actually I was suprised there wasn't an app like this available already - tons of apps for location faking in Play store but I already have my tools that expect the emulator interface, why change them! I think it was actually supported by Android at one point but was dropped and now the DDMS documentation says "The Emulator Control tab, shown in Figure 1, is no longer supported. Use the Android Emulator for these features.". It was not very difficult to create this app and hopefully it will be useful to others!
Running MockGeoFix on Android <=5.1
A bit too detailed guide on how to run MockGeoFix on Android from Gingerbread to Lollipop (the process is a little different on Android 6 and newer)
Install MockGeoFix
you can install directly from Google Play or get an APK here.
Enable developer options
go to Settings->About phone and click on Build number 5 times
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Enable Allow mock locations in Settings->Developer opions
open Settings->Developer options
enable Allow mock locations
Change location strategy to "device only"
open Settings->Personal->Location and click on Mode and select Device only
Start MockGeoFix
now start MockGeoFix and click on start and notice the IP address that is on your Wi-Fi network
Telnet to MockGeoFix (port 5554)
Open a terminal on your computer and telnet to the IP address from the previous step to port 5554
How to verify MockGeoFix is working with Google Maps
Start MockGeoFix, telnet to it and send "geo fix 0 51.476"
Open Google Maps and if prompted whether to improve accuracy by also using Wi-Fi for geolocation, even though it seems counter-intuitive, say yes. Then go back to Settings->Personal->Location and change Mode to Device Only. (At least when testing MockGeoFix on CyanogenMod12 I had to follow this strange procedure to get location mocking working in Google Maps, YMMV.)
click on the "locate me" button and here we go! (if nothing happens re-enter the geo fix command in the telnet session and try again)
How to verify MockGeoFix is working using ZachR's GPSDump
Another, more direct and foolproof way, to test that MockGeoFix is working is to use ZachR's GPSDump (org.ZachR.GPSDump in Google Play)
After tapping the "GPS Dump" button you should see "Lat" and "Long" fields changed to the values sent with the "geo fix" telnet command:
Running MockGeoFix on Android >= 6.0
Running MockGeoFix on Android >=6.0
On Android 6 (and up) there is no "allow mock locations" option anymore but you have to select one up that is allowed to mock your locations. Otherwise just follow the guide for Android 5 in the previous post.
[/LIST]
[*]Select MockGeoFix as a mock location app in Settings->Developer opions
open Settings->Developer options
click on Select mock location app
and select MockGeoFix
Is it possible to add support for more NMEA sentences?
Which NMEA sentences do you need?

[TOOL][ADB][Windows]RAM-Hog Sniffer For Rooted Android Emulators

Given the case you feel your favorite Android emulator runs slowly, especially at a certain game, then you should remind that Android emulator's (AVD) performance mainly depends on correct setting of its
A: Android per app Heap Size granted
B: VM total RAM (read: Random Access Memory) allocated off host machine
Most emulators don't automatically take care of this, they are preset to standard values: it's on the user to correctly configure it.
User has to check and monitor for the RAM usage of an individual app/game on Android, has to check which app/game is eating the maximum RAM and affecting the performance.
Yes, for me one of the fundamental questions users ask (or at least, they should) is: how much memory is my program using? It may be a simple question, but with a virtual memory operating system like Android the answer is quite complex.
By default Android OS - a derivate of Linux OS - since ages comes with procrank tool, what in detail shows you some RAM metrics for an application as those are VSS, RRS, PPS and USS. So also Android OS provided by the various emulators should do it, too.
Installed Terminal Emulator app on some wellknown emulators and ran procrank. Experienced that on Android emulators like
BlueStacks 4 ( Android Nougat )
PROCRANK doesn't work at all, you get message: "error creating kernel interface -- does this kernel have pagemap?"
MEmu 6 ( Android Nougat )
PROCRANK doesn't exist - means isn't implemented at all
NOX 6 ( Android Nougat )
PROCRANK isn't working, you get message: library "libpagemap.so" not found
Genymotion 3 ( Android Nougat )
PROCRANK doesn't work at all, you get message: "error creating kernel interface -- does this kernel have pagemap?"
Maybe someone knows reasons for that?
Hence, to get out the app/game specific RAM metrics ( read: VmPeak, VmVSS, VmHWM, VmRSS and VmPSS ) on an Android emulator, I wrote a Windows command script ( ~50KB ) that running against a rooted emulator gives them to me: I named it RAM-hog Sniffer. Notes: It's provided on an "AS IS" basis, it's free software, and you are welcome to redistribute it under license GPLv3.
Successfully tried it on properly rooted and ADB-enabled BlueStacks v4.50.5.1003 ( Android Nougat ):
Excerpt of logfile created:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Useful or not is for you to tell, give it a try and leave a comment with suggestion if indicated.
Usage:
• Download the attached ZIP and unpack it on Windows PC into any location of your choice
• Connect a rooted and ADB enabled emulator to PC
• Run Windows batch-file named RAM-hog-Sniffer
FYI: You will need to install the Android ADB drivers if your emulator is not detected.
PS: Please, do NOT share this elsewhere - I want to be able to update if necessary.
Script revamped. New version is in OP.
gr8. ty
To keep you updated: BlueStacks announced to fix the PROCRANK problem
According to the description I think something good,
but, can the script, not to change to the installed system,
for editing on a computer.>?
Ciuma777 said:
According to the description I think something good,
but, can the script, not to change to the installed system,
for editing on a computer.>?
Click to expand...
Click to collapse
You use any ANSI-editor of your choice, preferredly of course Notepad++, to edit the script on your Windows computer according to your needs.

Categories

Resources