A few command line utilities for RT - Windows RT Development and Hacking

So not to clutter up an 'apps' list, I am putting together pieces to enable my surface rt to have more functionality available for on device scripting and a put together a few utilities to fill some areas I think (?) were missing. I might use these from scripts, nodejs, powershell or anywhere else I might launch processes.
So for starters I made :
csnotify - A utility to simulate the toast notification banners (like what you see for weather or new mail alerts). Unfortunately the api used to actual system notifications are c++ sdk binaries which i can't use, so this is as close a clone as i could make. The options are many and explained in a readme file in the zip.
naudiocon - a simple console mp3 file player which i might use for sound effects but it plays a song just as well. There are many pieces to the open source NAudio library which could be useful for future audio media players.
wget - a simple way to download a file from a url via command line. not a true clone of wget but you can enter wget {url} or wget {url} newfilename. run without any params to see that usage syntax.
cryptocli - a simple command line file encryption and hashing utility. Possibly useful for email or sending between computers which has this utility installed. like most ports this runs on arm or intel windows.
speak - a simple text to speech utility to read text either from command line itself or from file specified in command line.
wscon - command line web server. spin up server on -p port and -d directory from command line or put shortcut to this app in 'shell:sendto' to send a -directory- to it (using default port or 8080)
The files are already signed, but if you download directly to your device you should probably right click the downloaded zip(s) and 'unblock' them on the file 'properties' page. This seems to be required when downloading to NTFS partitions, as it will flag the download as 'coming from an unsafe domain' (internet). If you save the file to non-ntfs sdcard/usb/nas you should not have to unblock.

nazoraios said:
So not to clutter up an 'apps' list, I am putting together pieces to enable my surface rt to have more functionality available for on device scripting and a put together a few utilities to fill some areas I think (?) were missing. I might use these from scripts, nodejs, powershell or anywhere else I might launch processes.
So for starters I made :
csnotify - A utility to simulate the toast notification banners (like what you see for weather or new mail alerts). Unfortunately the api used to actual system notifications are c++ sdk binaries which i can't use, so this is as close a clone as i could make. The options are many and explained in a readme file in the zip.
naudiocon - a simple console mp3 file player which i might use for sound effects but it plays a song just as well. There are many pieces to the open source NAudio library which could be useful for future audio media players.
wget - a simple way to download a file from a url via command line. not a true clone of wget but you can enter wget {url} or wget {url} newfilename. run without any params to see that usage syntax.
cryptocli - a simple command line file encryption utility. Possibly useful for email or sending between computers which has this utility installed. like most ports this runs on arm or intel windows.
The files are already signed, but if you download directly to your device you should probably right click the downloaded zip(s) and 'unblock' them on the file 'properties' page. This seems to be required when downloading to NTFS partitions, as it will flag the download as 'coming from an unsafe domain' (internet). If you save the file to non-ntfs sdcard/usb/nas you should not have to unblock.
Click to expand...
Click to collapse
Thanks definitely going to be using wget. If only we could make a port of bash...
Sent from my SGH-M919 using XDA Free mobile app

Qiangong2 said:
Thanks definitely going to be using wget. If only we could make a port of bash...
Sent from my SGH-M919 using XDA Free mobile app
Click to expand...
Click to collapse
Bash shell would be great, git-bash would be even better.
There's a lot of c++ projects that I haven't been able to set up visual studio to compile for arm. vs2013 and 2015 haven't been playing very well so far, I think mamaich successfully did some arm ports with vs2012. Then there's Win10 iot efforts which Microsoft may be more inclined to support officially. They seem to support console c++ apps on win10arm using vs2015 here :
http://ms-iot.github.io/content/en-US/win10/samples/ConsoleApp.htm
I have not even begun trying to set up MinGW/Cygwin which I believe is the toolchain required for cross compiling Linux source projects for win/arm.

nazoraios said:
Bash shell would be great, git-bash would be even better.
There's a lot of c++ projects that I haven't been able to set up visual studio to compile for arm. vs2013 and 2015 haven't been playing very well so far, I think mamaich successfully did some arm ports with vs2012. Then there's Win10 iot efforts which Microsoft may be more inclined to support officially. They seem to support console c++ apps on win10arm using vs2015 here :
http://ms-iot.github.io/content/en-US/win10/samples/ConsoleApp.htm
I have not even begun trying to set up MinGW/Cygwin which I believe is the toolchain required for cross compiling Linux source projects for win/arm.
Click to expand...
Click to collapse
Windows RT was probably coded using vs2012, that's why it's better to use vs2012. Also, Microsoft removed and changed lots of stuff in vs2013 and even more in vs2015 from vs2012. Vs2013 and 15 probably don't have the right commands built in
Sent from my SGH-M919 using XDA Free mobile app

hey i made batch file with sample commands for csnotify
p.s save the file with .bat
p.p.s i seek a bug, the -m text dont support long words

roxas22 said:
hey i made batch file with sample commands for csnotify
p.s save the file with .bat
p.p.s i seek a bug, the -m text dont support long words
Click to expand...
Click to collapse
since your parameter has spaces in it you should wrap it in quotes like :
Code:
csnotify -t "hi xda!!!" -m "i love xda!!!"

nazoraios said:
since your parameter has spaces in it you should wrap it in quotes like :
Code:
csnotify -t "hi xda!!!" -m "i love xda!!!"
Click to expand...
Click to collapse
Thanks, i have some problems with usising batch language

Well I finally figured out how to tap into speech libraries on windows rt, so I created a command line utility.
You can use it to speak some generic text by using this command line :
Code:
speak -t "hello world this is text to speech on windows rt"
Or you can pass in a filename :
Code:
speak "c:\some path to\filename.txt"
Or you can type "shell:sendto" into the address bar of windows explorer and create a shortcut to speak.exe in there and then you can then send text files to it and it will read them.
File should be attached for download.

I added a command line version of simplewebserver, which is called 'wscon' (webserver console).
bundled readme :
This is a console/parameter based version using much of the same code as SimpleWebServer program, but created for command line/script invocation.
The use case for this app is when you frequently change hosting directories and just want to spin up a server on some port and directory.
You can specify port and directory with -p and -d command line options or you can create a shortcut to this wscon program in your shell:sendto folder and right click a directory and 'send to' it.
If you use sendto it will use the default port set in wscon_settings.xml file, which is automatically generated in same folder as executable. Once this file exists you can override the default port of 8080 to be something else if you want.
If you launch from console with just -d option it will use default port in wscon_settings.xml also.
By default this application serves up only to local machine (localhost), if you run it as admin it will be visible to other computers (provided firewall allows).
Click to expand...
Click to collapse

Related

[TUTORIAL] FM TRANSMITTER (dev needed)

please vote on the poll if you would like to see the transmitter support!!!
the evos Broadcom chip has a built in fm receiver and also a transmitter.
according to some threads and diagrams ive seen the transmitter does have a power source, it just doesnt have and software code to actually work.
like hdmi the hardware was there but there was no code set up, therefore we didnt have full hdmi out. it had to be built from scratch.
the hardware for the fm transmitter is there we just need some one to build the code for it.
some one please take this on!!
This tutorial was originally posted in > android development and hacking > android software development.
i am reposting it here in the evo forums for guidelines
its a nice tutorial but its old. i think it was for android 2.0 ive followed the tutorial but i couldnt get it working, and i by no means have the experience to switch things up and get it working.
[TUTORIAL] Reverse engineering HTC FM Radio for noobs (on EVO 4G)
Okay, I'm writing this because I want to help any other newbies trying to learn how to reverse engineer. The technical details involved in this are extremely daunting, so the purpose of this tutorial is to first explain in layman terms exactly what you're trying to accomplish and what to expect. Then we'll go over the details. That way you're not completely blind going into this. I'm fairly new to the scene, so I'm not as knowledgeable as everyone else. If you see any errors in my post, let me know so I can change. I'm going to assume you know a little bit of Java, can find your way around a computer, and know nothing about Android. The techniques used should work with other Android phones. For this tutorial I'm using Windows 7, Cygwin, and my stock (not rooted) EVO 4G mobile phone.
The FM tuner for the Evo is run by a Broadcom chip: BCM4329. This chip is pretty amazing in that it does wireless, bluetooth, and it has an FM receiver/transmitter. We're interested in the FM receiver / transmitter.
Now, all android phones are based on a Linux kernel. Basically they're Linux running computers. The Android operating system is then installed onto the linux system. Every app is then run off of Android.
Android is based on Java but it is not a Java system. It uses a virtual machine called Dalvik. Google did this to get around licensing issues with Sun Microsystems. So they pretty much invented their own machine language (called byte code) for the Java language. This makes things complicated for the reverse engineer because from what I've read, once Java is converted into this machine language or byte code, it can't be converted back.
So let's rehash.
If you were programming strictly in Java, you would see these extensions:
Java source code = .java
Compiled Java source code = Java byte code = .class
Compressed file to package your program = .jar (Java Archive)
But since you're programming in Android and Dalvik, you will see these:
Java source code = .java
Compiled Java source code = Dalvik byte code = .dex
Compressed file to package your program = .apk
(I haven't mentioned this, but HTC further Optimizes their .dex code)
Optimized Dalvik byte code = .odex
I'm writing all of these down because it's very easy to get confused with all of the extensions. (for me at least!). remember how I said once you go dex, you can't go back to java? That's where JesusFreke comes in. He's a senior member of XDA, and he created "baksmali" and "smali", two programs that can convert the Dalvik code back into a human readable format. These files have extensions of .smali
Decompiled Dalvik byte code = .smali
But what can you do with .smali files? That's where this other senior member, brut.all comes in: He developed apktool. apktool takes JesusFreke's work to the next level. This program in conjunction with NetBeans, actually lets you trace through any program using the .smali code taken from JesusFreke's programs!
apktool does this by converting those .smali files into "fake" .java files that can be used by the NetBeans (program that compiles and makes java programs) IDE. I say "fake" because apktool embeds the .smali code into java files as comments. However, once you attach a debugger to NetBeans, you'll see that the debugger will follow line by line every execution statement found in the smali code!
So...... you can take the program you want, plug it into Net Beans using a debugger (using the default ddms command provided by Android SDK), and you can trace everything you do in the program. I have it connected to my phone, so whenever I push a button while running my HTC FMRadio app or unplug my headphones,I see the corresponding response to the HTCFMRadio code I have loaded in NetBeans. I can now see in real-time how the program operates from my own interactions... JAM.
Technical Aspects: How to get from ground zero to tracing HTCFMRadio?
1.) Download Android SDK - Go to google development site and follow instructions: Make sure to download the latest Java JDK. Once that is installed, download NetBeans 6.8. Unfortunately, smali debugging does not work with the lastest versions of NetBeans.
Download the "Java SE" version for minimal space
http://netbeans.org/downloads/6.8/index.html
You can follow the rest of Google walkthrough and download Eclipse and ADT plugin, but it's not pertinent to this. You're going to be using adb and ddms from the android SDK extensively, so make sure the path for </android SDK/tools> is included in the PATH variable in your ENVIRONMENT SETTINGS. To get here, right click My computer, click properties, Advanced Settings, ENVIRONMENT SETTINGS.
2.) Search for 7z and download it. It is an awesome and free compression tool that will be extremely useful. It can be used to "unzip" .jar, .apk, and other compressed formats.
3.) Get the Radio app. You can do this by going to "shipped-roms" website, downloading the latest Supersonic image, and following the directions in the unlockr tutorial for HTC kitchens at the unlockr website... (once you have extracted the files from the image, you can look in the system/app and system/framework directories to get the files listed below) or:
you can pull the following files from your phone:
Using the command prompt type (and with phone plugged in, and with USB debugging enabled on phone):
adb pull /system/app/HtcFMRadio.odex
adb pull /system/app/HtcFMRadio.apk
adb pull /system/framework ./framework
This will put HtcFMRadio.odex and HtcFMRadio.apk in the current directory and create a framework directory with more files. A couple of the files in the framework are needed for the HtcFMRadio app, but for simplicity, we're just going to pull the whole directory.
Now that we have the files, we have to make a few changes to make the app installable and to be viewable by the debugger. To do this we have to decompile the .odex format into a human readable format we can edit. That brings us to:
3.) Download baksmali and smali from Project Hosting on Google Code (google search smali).
Usually an Android application is made up of one file, an apk file. Inside the apk file is an AndroidManifest.xml file, a classes.dex file (compiled Java code for the program), and other folders. The other folders contain either graphics or other .xml files that tell the program how it should look to the user. We don't have to worry about those for now. This is important because APKTOOL only opens programs set up this way. But wait up? We didn't download one .apk file, we downloaded an .apk file and an .odex file! What gives? Well, if you right click the apk file and open it (using 7z), you'll see that it's missing the classes.dex file. The dex file for the app is actually the HtcFMRadio.odex file we downloaded. So, to make this system app more like a nominal app, we have to find a way to convert the HtcFMRadio.odex to a classes.dex file. That's easy with baksmali and smali!
Once you download goto command prompt and type:
java -jar baksmali-<version>.jar -d framework -x HtcFMRadio.odex
(Remember to match baksmali-<version>.jar with the filename of baksmali you downloaded)
If done correctly, you should see a newly created \out directory
This creates an out\com\htc\fm directory with many .smali files.
Now let's reverse the process and put it back as a dex file. Type at command prompt:
java -jar smali-<version>.jar out -o classes.dex
If done correctly you'll see a newly created classes.dex.
now, right click on HtcFMRadio.apk (select 7z and open). Drag classes.dex into the file. Say yes to the prompt. Now you have a normal apk file APKTOOL can read!
4.) Download APKTOOL from Project Hosting on Google Code and the helper apps for your OS. (If you're extracting files for windows OS you should have apktool.bat and aapt.exe). Extract (again using 7z, don't you love this program?) apktool.jar (keep it as a jar file, don't extract the stuff inside of it), apktool.bat, and aapt.exe to the directory you're working on. To make things neat, you can also delete HtcFMRadio.odex (you don't need it anymore) and classes.dex (make sure you put it in the HtcFMRadio.apk file first!)
If this is the first time you're using apktool, then you have to install the htc framework so apktool can baksmali the Radio app. You only have to do this once:
apktool if ./framework/com.htc.resources.apk
Alright, at the command prompt:
apktool d -d HtcFMRadio.apk
This extracts the contents of HtcFMRadio.apk and places them in the HtcFMRadio directory. However, there are two major differences between this content and the content created in step 3. If you go into the smali directory you'll see that instead of .smali files, you'll see .java files. And if you go back and edit the AndroidManifest.xml file, you will also see that it's in text! Android applications convert their xml files to binary format. Now that APKTOOL has converted everything to an IDE friendly format, we can use NetBeans to edit everything. The first thing we're going to do is edit AndroidManifest.xml (using notepad) and add the following:
android:debuggable="true" to the Application tag.
IT should now look like this:
<application android:theme="@android:style/Theme.Black.NoTitleBar" android:label="@string/fm_app_name" android:icon="@drawable/fm_radio" android:taskAffinity="android.task.fmradio" android:description="@string/htc_corp" android:allowTaskReparenting="true" android:debuggable="true">
This permission lets the debugger watch the program while it's running on the phone.
We are going to run into two problems if we try to install this program. One is that Android doesn't let you install more than one copy of a system app. The second issue is that if we change the signature of our system app, then we'll have to change the signatures of our other system apps as well! Ahh.... So, to get around that, we're going to trick Android into thinking we have a completely new program. We're going to do that by renaming the com.htc.fm class to com.htc.modradio class. Next step:
5.) Cygwin (or Linux virtual machine)
The easiest way that I can think of to replace strings in multiple files is by using linux. You can most definitely do it in WIndows, but I dont know how. If you let me know how, I can put it in this tutorial.
(update: you can use Notepad++ to easily find/replace strings in multiple files for Windows. You still, however, want to download Cygwin if you're going to develop with Android-NDK.)
For now, just search for Cygwin (Cygwin is a program that lets you run Linux commands from a command prompt using your Windows directories), and install it. Make sure to have the Perl option selected. You'll need Perl to make the following commands work.
Once you get Cygwin up and running
cd <to your HtcFMRadio directory>
in my case it's
cd /cygdrive/c/Users/Jerry/Desktop/HtcFMRadio
now type the following commands in this order:
this command changes all occurances of htc/fm to htc/modradio in your xml and .java files.
find ./ -type f | xargs perl -pi -e 's/htc\/fm/htc\/modradio/g'
this command changes all occurances of htc.fm to htc.modradio
find ./ -type f | xargs perl -pi -e 's/htc.fm/htc.modradio/g'
If you don't follow this order, your source code will get messed up.
If using cygwin, a bunch of .bak files will be created. Using windows search, find all .bak files in your HtcFMRadio directory, then select them all and delete them (Make sure they are only files with .bak!)
Now just rename the fm directory to modradio. It is located in HtcFMRadio/smali/com/htc
Now go to your windows command prompt and type:
apktool b -d .\HtcFMRadio modradio.apk
Now sign and install modradio.apk on your phone.
adb install modradio.apk
If you have never signed before, then you need to use keytool and jarsigner. These two files are in your JDK directory, so make sure you include your JDK directory in the PATH variable of your ENVIRONMENT SETTINGS. (To get here, right click on My Computer, click Properties, Advanced Settings, Environment Variables. Once you make change, open up a new COMMAND prompt to see changes).
cd to the directory which has modradio.apk
now type:
keytool -genkeypair
Answer all questions, then use the same password for all password prompts.
Next type:
jarsigner -verbose modradio.apk mykey
Type in the password you created in the above step. Your apk should now be signed.
Next install:
adb install modradio.apk
Success!
6.) Testing the app on phone
Go to your phone and you'll now see a new FMRadio icon next to your first. Click on it and watch it open. It should now be able to play music. Keep it open.
7.) Using Netbeans
Go into HtcFMRadio and delete the build directory created by APKTOOL.
Now open up Net Beans and click on File, New Project, Select Java Project with Existing Sources, click on Next
Select HtcFMRadio directory for Project Folder, rename Project Name to whatever you want. Let's type in ModRadio. click on Next
Next to "Source Package Folders" click on "Add Folder" and select the smali directory.
Click Finish. For a quick tutorial by Brut.all, search APKTOOL in youtube and click on: Apktool Demo 2 - Smali improvements
Right click on Libraries. Click on "Add Jar / Folder". You want to add Android.Jar. Since I have Android 2.1 loaded I went to /platforms/android-7 located in my android SDK directory.
Your project is now ready for editting!
8.) Running the Debugger to trace through program.
Next go back to Windows command prompt and type ddms. This runs the Dalvik Debug Monitor. A window should open up. In the left hand side you should see com.htc.modradio. That's our app! To the right you're going to see 2 numbers, you're interested in the one to the right, 4 cells away from com.htc.modradio. This number is a port number, and you're going to use it to communicate with NetBeans. (In my case it is 8603)
Go back to NetBeans and click on Debug, Attach Debugger.
In the host field type: localhost
In the Port field: type in the second number you saw. (8603)
If everything is working you'll see a bug appear next to com.htc.modradio in the Dalvik Debug Monitor. Look at the bottom bar of NetBeans for feedback. If you get errors make sure the numbers match, or try port 8700 and make sure you select com.htc.modradio in the Dalvik Debug Monitor. Port 8700 is the default port used for whatever program you select in Dalvik Debug Monitor.
9.) Setting a breakpoint
I'm making this a seperate step because it is completely arbitrary. When creating a break point be sure to follow this rule:
You must select line with some instruction, you can't set breakpoint on lines starting with ".", ":" or "#".
Rather than looking for a spot to breakpoint, though, I'll tell you where to put one so you can quickly see how the debugger traces through the code. You aren't "REQUIRED" to do the next step, but if you want to trace you have to put a breakpoint somewhere.
In Net Beans click on the Project tab, click on Source Packages, com.htc.modradio, and then doubleclick on BroadcomFMTuner.java
We're going to insert a breakpoint. Scroll down to line 3226 and on your keyboard press: CTRL-SHIFT-F8, select line in dropdown box and hit ok. (To keep it simple, I usually look for "invoke" instructions to set breakpoints at)
Now go to your phone and click on the physical "back" button on your phone. This will clear the radio,(you should still be able to listen to music). Drag your status bar down. You should see a radio icon. Click on it again. The radio backgroudn will appear, but you wont' see any text or anything. Now go back to your netbeans application. You should now see debug options highlighted! Click on Step Over (F8) to step through!
{
"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"
}
i found a few things.
http://pdf.eccn.com/pdfs/Datasheets/Broadcom/BCM4329.pdf
http://www.broadcom.com/products/Bluetooth/Bluetooth-RF-Silicon-and-Software-Solutions/BCM4329
I've read everything there is about this, and have yet to see anyone get it working. I don't have nearly enough experience to even take a stab at it, but I would love it.
The only phone I've seen where it was implemented was my first sprint phone: LG FUSIC, And I used it all the time.
yea im hoping some one actually tries to get it working
apple products use this same chips interesting...
http://jaxov.com/2010/04/ipad-can-play-fm-radio-broadcom-bcm4329-chip-found-by-ifixit/
i would love to see this working
I think I read about this before the EVO was released and a bunch of people got all excited but nothing ever really happened!
http://forum.xda-developers.com/showthread.php?t=693253
Not trying to rain on anyone's parade because this would be cool if it actually took off the ground BUT I doubt it will go anywhere because two reasons in my opinion!
1. Is easier to just buy a FM transmitter, some as low 35 dollars
http://www.amazon.com/Generation-Transmitter-integrated-Gomadic-TipExchange/dp/B0045DIQ9K
2. The developers on here have soooo much on their plate already. For example I think everyone would rather have Sense 3.0 up and running instead of this.........BUT like I said before, I'm not trying to rain on any parade! I for one would donate, support or whatever if we could actually get someone working on this ASAP.
That is all....LOL
I think this is just as important as HDMI and 4G.
In all honesty, I've never used HDMI or 4G.
This on the otherhand, is something I'd use everyday, as would many others.
Good luck to those who take it upon themselves to become immersed in this project.
I'd love to see this come off the ground.
~ I'm a fungi
Edit: one thing comes to mind....
What would be used as an antenna?
i think that is the biggest prob the headphones act as a headphone for the fm transmitter that would prob mean we would have to have headphones in to see any real use out of this thing
filebug said:
i think that is the biggest prob the headphones act as a headphone for the fm transmitter that would prob mean we would have to have headphones in to see any real use out of this thing
Click to expand...
Click to collapse
That, to me, seems like the smallest problem...
~ I'm a fungi
From what I've read the antenna is already built in.
Sent from my PC36100 using XDA Premium App
a senile fungus said:
That, to me, seems like the smallest problem...
~ I'm a fungi
Click to expand...
Click to collapse
He means the headphones act as an antenna, which defeats the purpose of the transmitter, at least for me, since the purpose of the transmitter, in my case, is to broadcast my music to my car radio.
And to the guy who said the antenna is built in, if you try to use the FM radio, it will tell you you need to plug in headphones to use as an antenna. At least, the MIUI radio did.
Yes but that is stock app. If an app is built you can over ride that request.
The reason for the headphones is obviously get better reception.
They wouldn't be needed BC the FM would only need to transmit about 5 to 10 feet.
Sent from my PC36100 using XDA Premium App
dtr145r said:
Yes but that is stock app. If an app is built you can over ride that request.
The reason for the headphones is obviously get better reception.
They wouldn't be needed BC the FM would only need to transmit about 5 to 10 feet.
Sent from my PC36100 using XDA Premium App
Click to expand...
Click to collapse
Actually you would need an antenna. Take a blank headphone plug and plug it into the headphone jack to enable the receiver then try to tune in a radio station. Unless you a very close to the transmitting station you are not going to hear much other than hiss. Receivers are not as picky to antenna length as transmitters are. As long as the length of wire is close to the resonant frequency in length a receiver will operate fine. With transmitters you are now pushing a current through it. If the antenna is not there, or cut close to the resonant operating frequency that RF energy will be reflected back into the transmitter causing it to heat up,and eventually fail.
In our EVO's there are several antennas inside. Mainly for connecting to cellular, 3g, 4g, BT/WiFi on the UHF bands. FM broadcast is on the lower portion of the VHF band. So the FMBC antenna (3meters) will be considerably longer than say lower CDMA antenna (42cm). The higher the frequency the shorter the wavelength (and antenna).
http://en.wikipedia.org/wiki/Cellular_frequencies#Frequency_bands_used_in_the_United_States
To fashion an antenna for this project you would need a blank headphone plug, some sort of material to fashion a dipole antenna (if you or someone you know makes plastic models the left over plastic would be perfect. Wood is not a good insulator to this project), and very thin insulated (painted) speaker wire. now for a full wave antenna you will need about 9 feet of wire (you can shorten it to 1/2, or 1/4 wave). Take the plastic rods from a model kit and fashion it into a T placing the lower part of the T into the plug then running the wires from the appropriate connections in the plug up to the top portion of the T then winding the wire out to each end. Effectively making a loaded dipole antenna.
Now I skipped alot of stuff because I don't have all the information on the chip used so I don't know if it has a tuning circuit for loading the transmitting antenna or not. You may have to add a capacitor at the top of the T between the two stubs to properly tune it. the reason I chose a dipole over a omnidirectional (whip) is because the dipole is more efficient, and easier to tune. As a matter of fact the antennas in most cellphones are now dipoles. Since most phones now have to operate hands free the omnidirectional (whip) is impractical since our hands were used as the groundplane.
Hope this helps.
Where's teamwin at .....
Igotsanevo4g said:
Where's teamwin at .....
Click to expand...
Click to collapse
now thats the comment I was anticipating.
So do all those FM transmitters we buy have 9ft of wire for the antenna?
Sent from my PC36100 using XDA Premium App
aimbdd said:
So do all those FM transmitters we buy have 9ft of wire for the antenna?
Sent from my PC36100 using XDA Premium App
Click to expand...
Click to collapse
More than likely no. The use loading coils, and coil-capacitor circuits. Depending on which is cheaper at the moment, and enclosure size.
For a fullwave antenna yes. Several things you can do to "shorten" it. You can coil it, you can cut it to the appropriate wavelength (1/2, 1/4, or 1/8th wave), and coil it. The drawback is once you shorten it either way you narrow the bandwidth, and the ability to properly tune it to whatever frequency you set the transmitter to.
For example using the full sized antenna you are able to use the transmitter the full broadcast band (87MHz-107.5MHz) with it not going out of tune causing power loss, and power being reflected back to the transmitter itself. Shorten the antenna to a 1/2 wave (4.5') you may be only be able to tune from say 95MHz to 102MHz, and so on. Effectively you are narrowing the amount of usable bandwidth you can use. now you can make an L-C (capacitor-coil) circuit so you can use the full spectrum but you will incur line losses so your effective radiated power will be lower (not that you had much to begin with). Depending on your receiver that you would be transmitting to the lower power may lead to more outside interference (ie noise).
ive been trying to find the pin out for the broadcom chip but i cant find it anywhere.
dtr145r said:
ive been trying to find the pin out for the broadcom chip but i cant find it anywhere.
Click to expand...
Click to collapse
I've been trying as well. Broadcom posted almost every other chip's datasheet, but not that one.. I am going to call Broadcom's tech support line on Monday and see if I can get one out of them besides that crappy incomplete block diagram in the promo handout. Know anybody that has the actual schematic for the EVO? That would even be more helpful. Then you would know what is, and what is not connected. Plus you wouldn't have to tear one down to check the connections.
any update?, this is a very good idea for everybody that don't have a bluetooth radio.
i can't wait for somebody to get this going
bump bump.

[GUIDE] How To Install and Use Android SDK

{
"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"
}
*If you find this Guide Thread helpful, feel free to hit the "thanks" button below!​
What is Android SDK?
Everyone wants to program on Android; unfortunately, not everyone knows quite how to get started with their development environment. Google has put out both the Android SDK and the Android ADT in order to help developers integrate Android into their dev environment as well as facilitate more Android development. In this guide, we’ll take a look at how to set up a development environment for Android so you can start creating projects. Android SDK and Android ADT are essentials that you will need to include in your Android Developer Toolbox for use with many things, and can be a very powerful set of components from the simple, to the complicated. When it comes to Android modding, most novice users are confused or left wondering by reference over reference to a certain “adb”. This is specially true when you are looking up something on modding your device, or root it in particular. ADB is the wonder toy of Android and everyone seems to love it, so lets have a look at understanding what it is and why you need it, and how you can get it.​
What is ADT?
ADT (Android Developer Tools) is a plugin for Eclipse that provides a suite of tools that are integrated with the Eclipse IDE. It offers you access to many features that help you develop Android applications quickly. ADT provides GUI access to many of the command line SDK tools as well as a UI design tool for rapid prototyping, designing, and building of your application's user interface. Because ADT is a plugin for Eclipse, you get the functionality of a well-established IDE, along with Android-specific features that are bundled with ADT. The following describes important features of Eclipse and ADT:
Integrated Android project creation, building, packaging, installation, and debugging
ADT integrates many development workflow tasks into Eclipse, making it easy for you to rapidly develop and test your Android applications.
SDK Tools integration
Many of the SDK tools are integrated into Eclipse's menus, perspectives, or as a part of background processes ran by ADT.
Java programming language and XML editors
The Java programming language editor contains common IDE features such as compile time syntax checking, auto-completion, and integrated documentation for the Android framework APIs. ADT also provides custom XML editors that let you edit Android-specific XML files in a form-based UI. A graphical layout editor lets you design user interfaces with a drag and drop interface.
Integrated documentation for Android framework APIs
You can access documentation by hovering over classes, methods, or variables. ​
What is ADB?
ADB stands for Android Debug Bridge. It comes as a part of the standard Android SDK, which you can grab here in this guide. Basically, it provides a terminal-based interface for interacting with your phone’s file system. Since Android platform is based on Linux, command-line is sometimes the only way to obtain and manipulate root access often required to perform certain advanced operations on your device using root access. While these things can be done directly on the device itself using some terminal emulator, it will be rather difficult to execute complex commands on such a small screen. ADB provides the bridge between your machine and your computer.​
Preface: Dev Environment Notes:
Just a general rule to reduce headaches, if you're serious about Android development, your development machine should primarily be a development machine, as installation of other various programs may clutter it up and produce unexpected errors or other bizarre happenings. While this is rare, it’s not uncommon, and an exclusive development machine is recommended. If an extra machine is not available, a virtual machine used as a development machine works very well also. If this isn't an option either, you can always install Ubuntu 12.04 on your Windows PC and select whichever operating system you'd like at boot/reboot. The latter is my setup, since I run Windows 7 primarily, and Ubuntu for selected other functions -namely Android SDK. It's all your preference here, but keep in mind that if you start getting too deep in the rabbit hole with your Android development, you may want to consider a dedicated dev machine, or re-partition your Ubuntu setup to allow for more capabilities within it.​
Step 1: Install the JDK
Most of you probably have the Java JRE installed, but Android requires the JDK “Java Development Kit” to compile Java programs. The JDK is available on Oracle’s Java webpage. Install the version of the JDK appropriate for your OS; the Java EE 6 bundle is recommended, but you can install any bundle you like so long as it contains the JDK.
(Getting started on Ubuntu, see THIS PAGE)
Getting started on Windows:
Your download package is an executable file that starts an installer. The installer checks your machine for required tools, such as the proper Java SE Development Kit (JDK) and installs it if necessary. The installer then saves the Android SDK Tools into a default location (or you can specify the location). Make a note of the name and location of the SDK directory on your system—you will need to refer to the SDK directory later, when setting up the ADT plugin and when using the SDK tools from the command line. Once the tools are installed, the installer offers to start the Android SDK Manager. Start it and continue with the installation guide by clicking the Next link on the right. The Android SDK requires JDK version 5 or version 6. If you already have one of those installed, skip to the next step. In particular, Mac OS X comes with the JDK version 5 already installed, and many Linux distributions include a JDK. If the JDK is not installed, go to http://java.sun.com/javase/downloads and you'll see a list of Java products to download.
Linux users: Many Linux distributions come with an open source variant of the JDK, like OpenJDK or IcedTea. While you may be tempted to use these in support of open-source or for whatever reason, for maximum compatibility install the official Oracle JDK. You may choose to ignore this warning, but you may end up encountering obscure, strange errors because of it; if you do, most likely it’s some minor difference in the two JDKs.​
Step 2: Install Your IDE of Choice
You can by all means code straight up in Emacs or Vi; if you prefer doing that, this guide is not for you. For the rest of us, install a Java IDE; Eclipse is recommended as it is the IDE that the Android developers use and the IDE with official plugin support from Google. The rest of this guide will assume Eclipse is the IDE you’re using, but NetBeans has Android plugin support for it as well. When you download Eclipse, make sure to download Eclipse Classic or Eclipse for Java EE developers; there are quite a few flavors of Eclipse for download on their page, and you don’t want to end up with the C++ or PHP versions of Eclipse.
Obtain Eclipse
These alternatives may be available to obtain a copy of Eclipse for installation:
Download a current stable build of Eclipse from the Eclipse Web Site; note that the installation file is large (over 120 MB)
For the recommended package to download and install, click the link Eclipse IDE for Java EE Developers on the Eclipse Packages page. For the reason why this is the recommendation, see the following bullets:
There are a number of downloadable packages available, each a different "flavor" of Eclipse, which can be compared and contrasted from the Compared Eclipse Packages page. The recommended Eclipse package is the Eclipse IDE for Java EE Developers. This recommendation is made for those who develop in other languages / on other platforms as well, for the following reasons:
The "slimmer" Eclipse IDE for Java Developers lacks data tools, testing support, and parts of the Web Standard Tookit useful to all Java web application developers
The Eclipse Classic seems like it ought to be "slimmer" but in fact it is a larger download than the JEE package. Downloading and installing this package, then picking and choosing among additional packages described on the Eclipse Classic page is a viable alternative, but requires each developer to spend time researching the contents and utility of the multiple options.
Install Eclipse
There is no installer (executable program) used to install Eclipse. The process described below involves un-archiving (unzipping) a directory tree of files and placing it in an appropriate location on your hard disk. It is very strongly recommended that you locate the eclipse\ directory at the root of your computer's hard drive; or, minimally, on a directory path with no spaces in its name (e.g., C:\mystuff\eclipse\. It is worth noting that Eclipse does not write entries to the Windows registry; therefore, you can simply delete (or move) the installed files, shortcuts, and/or the workspace: there is no executable uninstaller either.
Unzip (or copy/unjar/check-out) the software into an appropriate location on your hard disk (e.g., C:\eclipse).
These instructions are written assuming that you are running eclipse from C:\eclipse; if you are using a different path, adjust accordingly.
Once the unzipped (copied/unjarred/checked-out) files are located on your filesystem, get started using Eclipse:
Run Eclipse by running C:\eclipse\eclipse.exe
The first time you run Eclipse, you will be prompted to identify a location for your Eclipse workspace. This is where local copies of your projects (files you check in and/or out of code repositories) will live on your file system. Do not create the workspace in a directory path that has spaces in it - i.e., not in the default C:\Documents and Settings\... directory presented by default on the first startup of Eclipse. Instead, it is recommended that your workspace be located at the root of your machine's hard disk, e.g., C:\workspace.
It is advisable to pass JVM arguments to Eclipse at startup to reserve a larger memory space for the IDE than the default. To, specify recommended JVM arguments, create a shortcut (probably on your desktop) with the following target (modified if you're using different directories):
Code:
C:\eclipse\eclipse.exe -jvmargs -Xms128m -Xmx512m -XX:MaxPermSize=128m
Step 3: Install the Android SDK
Now it’s time to install the Android SDK. You can grab it from the Android Developer website at:
http://developer.android.com/sdk/index.html​
Download the installer for your particular operating system, and open it up when you’re done:
Android SDK Manager
The Android SDK Manager is modular, meaning that you download the initial package and then download separate packages within the framework in order to provide more functionality. This lets the SDK be more flexible, as you don’t need to keep downloading entire packages every time a new version comes out; you can simply download the latest module and pop it into the SDK. You can pick and choose which modules to install, but if you’ve got the hard drive space I recommend installing all of the different flavors of Android; it will help later when debugging apps, especially on older Android OSes.​
Step 4: Install the Android ADT for Eclipse
NOTE: if you’re using NetBeans, you want the nbandroid plugin, found here:
http://kenai.com/projects/nbandroid/pages/install​
Now that the SDK is installed, you should install the Android ADT plugin. It’s not strictly necessary to do so, but the ADT offers powerful integration with many of the Android tools, including the SDK Manager, the AVD Manager, and DDMS, or dynamic debugging. All of these are extremely useful to have when creating an Android application, and if you want to skip them you should do so at your own peril!​
Eclipse ADT Plugin
To install the ADT, you’re going to have to add a custom software package to Eclipse. To do so, head over to the “Help” button on Eclipse’s menu and click the “Install New Software” button. Click “Available Software”, click “Add Remote Site”, and pop in this URL:
https://dl-ssl.google.com/android/eclipse/​
Eclipse ADT Install
Occasionally, for whatever reason, some people have trouble downloading the ADT from that secure site. If you’re having issues downloading the ADT, simply remove the “s” off the end of the “https”, and the download should work as intended. Once that’s done, head back over to the Available Software tab and check the boxes for Developer Tools, Android DDMS, and Android Development Tools; again, none of these are mandatory, but they’re all going to be very useful later on. The packages will take a bit to download; once they’re done, restart Eclipse!​
Step 5: Create an Android Virtual Device (or AVD)
Like the previous step, this step isn’t entirely necessary; you could do all your debugging and development work on an actual Android handset. Creating AVDs is a great way to see how your application might work across different operating systems and handset types, as AVDs can mimic not only different Android OSes but also different hardware; you can change such settings as heap size, display type, and maximum memory, making it useful to try and figure out where bugs are happening when you don’t own a multitude of different handsets to test on! To create an AVD, you can open the Android AVD manager from Eclipse from the “Window” button on the top bar, and go to “Virtual Devices”. From there, you can add, configure and delete them:
Android Virtual Device (AVD) Manager
NOTE: This isn’t IDE specific. For those of you running a different IDE, the AVD Manager can be accessed in the same manner as the Android SDK is accessed outside of Eclipse; this is just a very easy shortcut for those with the Android ADT installed. Need More Help? Try this 30-minute video put together by Guy Cole, that walks you through the complete step-by-step setup.​
So, You've Installed Android SDK, Now What?
The Android platform provides support for both speech recognition and speech synthesis. In this tutorial, we will create a simple Android app which allows the user to speak, attempts to recognize what they say, and then repeats what was recognized back to them using the Text To Speech engine.
Step 1: Start an Android Project​
Create a new Android project in Eclipse. Alternatively, if you want to implement the speech recognition functionality in an existing app, open it instead. For this tutorial we have a minimum SDK version of 8, and you do not need to make any particular additions to your Manifest file, the default contents should suffice.
Step 2: Define the User Interface​
Let’s start by defining the user interface. When the app launches, the user will be presented with a button. On pressing the button, the app will prompt them to speak, listening for their voice input. When the speech recognition utility processes the speech input, the app will present a list of suggested words to the user. As you’ll know if you’ve tried speech recognition as a user, the recognizer is not always accurate, so this list is essential. When the user selects an item from the list, the app will speak it back to them using the TTS engine. The TTS part of the application is optional, so you can omit it if you prefer.
The app is going to use a few text Strings as part of the interface, so define them by opening the “res/values/strings.xml” file and entering the following content:
Code:
<resources>
<string name="intro">Press the button to speak!</string>
<string name="app_name">SpeechRepeat</string>
<string name="speech">Speak now!</string>
<string name="word_intro">Suggested words…</string>
</resources>
Of course, you can alter the String content in any way you like.
Open your “res/layout/main.xml” file to create the main app layout. Switch to the XML editor if the graphical editor is displayed by default. Enter a Linear Layout as the main layout for the app’s launch Activity:
Code:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
androidrientation="vertical"
android:background="#ff330066"
androidaddingBottom="5dp" >
</LinearLayout>
The Linear Layout contains various style declarations including a background color. Inside the Linear Layout, first enter an informative Text View:
Code:
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/intro"
androidadding="5dp"
android:textStyle="bold"
android:textSize="16dp"
android:gravity="center"
android:textColor="#ffffff33" />
Notice that the Text View refers to one of the Strings we defined. It also sets various display properties which you can alter if you wish. After the Text View, add a button:
Code:
<Button android:id="@+id/speech_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/speech" />
The user will press this button in order to speak. We give the button an ID so that we can identify it in the Java code and display one of the Strings we defined on it. After the button, add another informative Text View, which will precede the list of suggested words:
Code:
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
androidadding="5dp"
android:text="@string/word_intro"
android:textStyle="italic" />
Again, this Text View uses a String resource and contains style properties. The last item in our main.xml Linear Layout is the list of suggested words:
Code:
<ListView android:id="@+id/word_list"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
androidaddingLeft="10dp"
androidaddingTop="3dp"
androidaddingRight="10dp"
androidaddingBottom="3dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:background="@drawable/words_bg" />
The List View will be populated with data when the app runs, so we give it an ID for identification in Java. The element also refers to a drawable resource, which you should add to each of the drawables folders in your app’s “res” directory, saving it as “words_bg.xml” and entering the following content:
Code:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:dither="true">
<gradient
android:startColor="#ff000000"
android:endColor="#ff000000"
android:centerColor="#00000000"
android:angle="180" />
<corners android:radius="10dp" />
<stroke
android:width="2dp"
android:color="#66ffffff" />
</shape>
This is a simple shape drawable to display behind the List View. You can of course alter this and the List View style properties if you wish. The only remaining user interface item we need to define now is the layout for a single item within the list, each of which will display a word suggestion. Create a new file in “res/layout” named “word.xml”and then enter the following code:
Code:
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
androidadding="5dp"
android:textColor="#ffffffff"
android:textSize="16dp" >
</TextView>
Each item in the list will be a simple Text View. That’s our interface design complete. This is how the app appears on initial launch:
Step 3: Setup Speech Recognition​
Now we can implement our Java code. Open your app’s main Activity and add the following import statements at the top:
Code:
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Bundle;
import android.speech.RecognizerIntent;
import android.speech.tts.TextToSpeech.OnInitListener;
import android.speech.tts.TextToSpeech;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
import android.widget.Toast;
import android.widget.TextView;
You may not need all of these if you do not implement the TTS functionality – Eclipse should highlight imports you have not used so check them when you finish coding. Extend your opening class declaration line as follows, altering the Activity name to suit your own:
Code:
public class SpeechRepeatActivity extends Activity implements OnClickListener, OnInitListener {
The “OnInitListener” is only required for the TTS function. Add the following instance variables inside your class declaration, before the “onCreate” method:
Code:
//voice recognition and general variables
//variable for checking Voice Recognition support on user device
private static final int VR_REQUEST = 999;
//ListView for displaying suggested words
private ListView wordList;
//Log tag for output information
private final String LOG_TAG = "SpeechRepeatActivity";//***enter your own tag here***
//TTS variables
//variable for checking TTS engine data on user device
private int MY_DATA_CHECK_CODE = 0;
//Text To Speech instance
private TextToSpeech repeatTTS;
Inside your “onCreate” method, your class should already be calling the superclass method and setting your main layout. If not, it should begin like this:
Code:
//call superclass
super.onCreate(savedInstanceState);
//set content view
setContentView(R.layout.main);
Next, still inside your “onCreate” method, retrieve a reference to the speech button and list we created, using their ID values:
Code:
//gain reference to speak button
Button speechBtn = (Button) findViewById(R.id.speech_btn);
//gain reference to word list
wordList = (ListView) findViewById(R.id.word_list);
The List View is an instance variable, accessible throughout the class. Now we need to find out whether the user device has speech recognition support:
Code:
//find out whether speech recognition is supported
PackageManager packManager = getPackageManager();
List<ResolveInfo> intActivities = packManager.queryIntentActivities(new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0);
if (intActivities.size() != 0) {
//speech recognition is supported - detect user button clicks
speechBtn.setOnClickListener(this);
}
else
{
//speech recognition not supported, disable button and output message
speechBtn.setEnabled(false);
Toast.makeText(this, "Oops - Speech recognition not supported!", Toast.LENGTH_LONG).show();
}
We query the environment to see if the Recognizer Intent is present. If it is, we instruct the app to listen for the user pressing the speech button. If speech recognition is not supported, we simply disable the button and output an informative message to the user.
Step 4: Listen for Speech Input​
Let’s setup the click listener for the speech button we’ve instructed the app to detect clicks for. Outside the “onCreate” method, but inside your Activity class declaration, add an “onClick” method as follows:
Code:
/**
* Called when the user presses the speak button
*/
public void onClick(View v) {
if (v.getId() == R.id.speech_btn) {
//listen for results
listenToSpeech();
}
}
Now implement the method we’ve called here after the “onClick” method:
Code:
/**
* Instruct the app to listen for user speech input
*/
private void listenToSpeech() {
//start the speech recognition intent passing required data
Intent listenIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
//indicate package
listenIntent.putExtra(RecognizerIntent.EXTRA_CALLI NG_PACKAGE, getClass().getPackage().getName());
//message to display while listening
listenIntent.putExtra(RecognizerIntent.EXTRA_PROMP T, "Say a word!");
//set speech model
listenIntent.putExtra(RecognizerIntent.EXTRA_LANGU AGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
//specify number of results to retrieve
listenIntent.putExtra(RecognizerIntent.EXTRA_MAX_R ESULTS, 10);
//start listening
startActivityForResult(listenIntent, VR_REQUEST);
}
Some of this code is standard for setting up the speech recognition listening functionality. Areas to pay particular attention to include the line in which we specify the “EXTRA_PROMPT” – you can alter this to include text you want to appear for prompting the user to speak. Also notice the “EXTRA_MAX_RESULTS” line, in which we specify how many suggestions we want the recognizer to return when the user speaks. Since we are calling the “startActivityForResult” method, we will handle the recognizer results in the “onActivityResult” method.
When the app is listening for user speech, it will appear as follows:
Step 5: Present Word Suggestions​
Implement the “onActivityResult” method inside your class declaration as follows:
Code:
/**
* onActivityResults handles:
* - retrieving results of speech recognition listening
* - retrieving result of TTS data check
*/
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
//check speech recognition result
if (requestCode == VR_REQUEST && resultCode == RESULT_OK)
{
//store the returned word list as an ArrayList
ArrayList<String> suggestedWords = data.getStringArrayListExtra(RecognizerIntent.EXTR A_RESULTS);
//set the retrieved list to display in the ListView using an ArrayAdapter
wordList.setAdapter(new ArrayAdapter<String> (this, R.layout.word, suggestedWords));
}
//tss code here
//call superclass method
super.onActivityResult(requestCode, resultCode, data);
}
Here we retrieve the result of the speech recognition process. Notice that the “if” statement checks to see if the request code is the variable we passed when calling “startActivityForResult”, in which case we know this method is being called as a result of the listening Intent. The recognizer returns the list of 10 suggested words, which we store as an Array List. We then populate the List View with these words, by setting an Array Adapter object as Adapter for the View. Now each of the items in the List View will display one of the suggested words.
If the app successfully recognizes the user input speech and returns the list of words, it will appear as follows:
Alternatively, if the app does not recognize the user speech input, the following screen will appear:
Step 6: Detect User Word Choices​
We want to detect the user selecting words from the list, so let’s implement a click listener for the list items. Back in your “onCreate” method, after the existing code, set the listener for each item in the list as follows:
Code:
//detect user clicks of suggested words
wordList.setOnItemClickListener(new OnItemClickListener() {
//click listener for items within list
public void onItemClick(AdapterView<?> parent, View view, int position, long id)
{
//cast the view
TextView wordView = (TextView)view;
//retrieve the chosen word
String wordChosen = (String) wordView.getText();
//output for debugging
Log.v(LOG_TAG, "chosen: "+wordChosen);
//output Toast message
Toast.makeText(SpeechRepeatActivity.this, "You said: "+wordChosen, Toast.LENGTH_SHORT).show();//**alter for your Activity name***
}
});
We use the “setOnItemClickListener” method to assign a listener to each item in the list. Inside the new “OnItemClickListener”, we implement the “onItemClick” method to respond to these clicks – this method will fire when the user selects a suggested word from the list. First, we cast the View that has been clicked to a Text View, then we retrieve the text from it. This text is the word the user has selected. We write the chosen word out to the Log for testing and output it back to the user as a Toast message. Depending on the needs of your own application, you may wish to carry out further processing on the chosen word – this code is purely for demonstration.
The user can press the touchscreen or use a trackball to select words in the list.
When the user selects a word, the Toast message appears confirming it.
Step 7: Setup TTS Functionality​
If you do not want to implement the Text To Speech functionality, you can stop now and test your app. We only require a little more processing to make our app repeat the user’s chosen word. First, to set up the TTS engine, add the following code to the section in your “onCreate” method where you queried the system for speech recognition support. Inside the “if” statement, after “speechBtn.setOnClickListener(this);”:
Code:
//prepare the TTS to repeat chosen words
Intent checkTTSIntent = new Intent();
//check TTS data
checkTTSIntent.setAction(TextToSpeech.Engine.ACTIO N_CHECK_TTS_DATA);
//start the checking Intent - will retrieve result in onActivityResult
startActivityForResult(checkTTSIntent, MY_DATA_CHECK_CODE);
Like the speech listening process, we will receive the result of this code checking for TTS data in the “onActivityResult” method. In that method, before the line in which we call the superclass “onActivityResult” method, add the following:
Code:
//returned from TTS data check
if (requestCode == MY_DATA_CHECK_CODE)
{
//we have the data - create a TTS instance
if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS)
repeatTTS = new TextToSpeech(this, this);
//data not installed, prompt the user to install it
else
{
//intent will take user to TTS download page in Google Play
Intent installTTSIntent = new Intent();
installTTSIntent.setAction(TextToSpeech.Engine.ACT ION_INSTALL_TTS_DATA);
startActivity(installTTSIntent);
}
}
Here we initialize the TTS if the data is already installed, otherwise we prompt the user to install it. For additional guidance on using the TTS engine, see the Android SDK: Using the Text to Speech Engine tutorial.
To complete TTS setup, add the “onInit” method to your class declaration, handling initialization of the TTS as follows:
Code:
/**
* onInit fires when TTS initializes
*/
public void onInit(int initStatus) {
//if successful, set locale
if (initStatus == TextToSpeech.SUCCESS)
repeatTTS.setLanguage(Locale.UK);//***choose your own locale here***
}
Here we simply set the Locale for the TTS, but you can carry out other setup tasks if you like.
Step 8: Repeat the User Choice​
Finally, we can repeat the user’s chosen word. Back in your “onCreate” method, inside the “OnItemClickListener” “onItemClick” method, after the line in which we output a Toast message, add the following:
Code:
//speak the word using the TTS
repeatTTS.speak("You said: "+wordChosen, TextToSpeech.QUEUE_FLUSH, null);
This will cause the app to repeat the user’s chosen word as part of a simple phrase. This will occur at the same time the Toast message appears.
Conclusion
That’s our complete Speak and Repeat app. Test it on an Android device with speech recognition and TTS support – the emulator does not support speech recognition so you need to test this functionality on an actual device. The source code is attached, so you can check if you have everything in the right place. Of course, your own apps may implement speech recognition as part of other processing, but this tutorial should have equipped you with the essentials of supporting speech input.​
Android SDK Commands & Explanations
Adb has many built in commands. Some are interactive (meaning they keep running until you stop them) and some just perform a simple task. Below is a list of the commands in the 1.0 SDK version of adb.​
Android Debug Bridge version 1.0.20
Code:
-d - directs command to the only connected USB device
returns an error if more than one USB device is present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is running.
-s <serial number> - directs command to the USB device or emulator with
the given serial number
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices - list all connected devices
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> <local> - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] <file> - push this package file to the device and install it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories)
adb bugreport - return all information from the device
that should be included in a bug report.
adb help - show this help message
adb version - show version num
DATAOPTS:
(no option) - don't touch the data partition
-w - wipe the data partition
-d - flash the data partition
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-product - prints: <product-id>
adb get-serialno - prints: <serial-number>
adb status-window - continuously print device status for a specified device
adb remount - remounts the /system partition on the device read-write
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PDP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be updated.
- If it is "system" or "data", only the corresponding partition
is updated.
Common Use:​
Some of the more common commands in adb are push, pull, shell, install, remount, and logcat.
Push sends a file from your desktop computer to your Android device:
Code:
adb push test.txt /sdcard/test.txt
Pull pulls a file from your Android device to your desktop computer:
Code:
adb pull /sdcard/test.txt test.txt
Shell lets you run an interactive shell (command prompt) on the Android device:
Code:
adb shell
Install lets you install an android APK file to your Android device:
Code:
adb install myapp.apk
Remount remounts the /system partition as writable (or readonly if it is already writeable):
Code:
adb remount
Logcat lets you view the devices debug logs in real time (must press control+c to exit):
Code:
adb logcat
Further Notes On This Subject
It's great to see guides like these. I think every device forum should have these stickied in their general section. We all have/had to start somewhere. Having nice guides with accurate up-to-date information is only going to benefit everyone, and makes learning and understanding much easier. Fact is, we're all here for the same reason, to capitalize on the potential our devices have, and enjoy them. So, thanks for putting this together. It might seem trivial to a lot of the more experienced people, but those who aren't will definitely appreciate it.
Thanks. This is helpful.
Sent from my MB865
Hey Apex great job on the guide
I just wish this was here the first time I installed the the android sdk
I'm sure it will be useful to alot of members
41rw4lk said:
I think every device forum should have these stickied in their general section.
Click to expand...
Click to collapse
+1
Sticky?
Speak only when it improves on your silence.
Sorry for OT, this is not for Atrix 2 but I have question :
I want to extract included kernel in CM9 Rom, it is inside boot.img file. I've used Android Kitchen for extracting, it's ok now. I had zImage file.
So now how can I build flash-able zip file for CWM ? Tried UpdateZipCreator program but it showed error (7) when flashing.
I just wanna test many difference kernels and then come back to original but no flashable CM9 kernel here on xda.
vinamilk said:
Sorry for OT, this is not for Atrix 2 but I have question :
I want to extract included kernel in CM9 Rom, it is inside boot.img file. I've used Android Kitchen for extracting, it's ok now. I had zImage file.
So now how can I build flash-able zip file for CWM ? Tried UpdateZipCreator program but it showed error (7) when flashing.
I just wanna test many difference kernels and then come back to original but no flashable CM9 kernel here on xda.
Click to expand...
Click to collapse
Okay, Jim will probably be the one to ask on this. I don't recall which device you have currently (viewing from my phone) but he's the one who wrote the kernel for CM9 on the SGS3. I'm assuming you want to run the CM9 rom with 'experimental' kernels, so I'd PM him and ask (Sorry Jim, lol) but I'm not the expert on kernels or Android Kitchen, least not as knowledgeable as I should be to give a suitable answer...
Sent from my SAMSUNG-SGH-I747 using xda premium
oh! thanks a lot! I am very happy to find this!
long long ago! I start to find this resourse :cyclops:
EXCELLENT! I don't know i didn't see this before. Maybe because i didn't have this phone in August i think.
But great, tomorrow i will see if i can combine one of my designs with this, and try to make an alpha app.
Good guide
Hit thnx for every help
I just wanted to obtain logcat but where to type adb logcat...I get this in sdk
luvk1412 said:
I just wanted to obtain logcat but where to type adb logcat...I get this in sdk
Click to expand...
Click to collapse
With the sdk.. go to android-sdk/tools/ folder and double-click monitor.bat - easiest/nicest way to watch the logs..
To set up adb to be used from the command prompt or terminal, make sure you set your environment variables (or your .bashrc in Linux) to the path of adb in the sdk (it's in platform-tools)..
For Windows (Win7 example): Go to Start> right-click Computer>Properties>Advanced System Settings>Environment Variables...
Look under System Variables to see if you somehow have the path to C:\android-sdk\platform-tools in there already (or your specific location - just don't use spaces in the folder names in your path). If not, click on PATH under System Variables and Edit it..
Add your path to adb.exe (C:\android-sdk\platform-tools, for exapmle) to the end of the string of paths there. You can also add the path to \android-sdk\tools for good measure..
Click OK.. "Revenge of the Fern" - inside joke...
For Linux (Ubuntu 12.04, for example): Go to your home folder, hit Ctrl+H, open the .bashrc, and add this (or your specific path) to the bottom:
Code:
# Android tools
export PATH=${PATH}:~/android-sdk/tools
export PATH=${PATH}:~/android-sdk/platform-tools
Then you should be able to open the command prompt or terminal and type: adb devices - and hopefully get your device id..
Then: adb logcat - for logcat (or just use the monitor.bat as mentioned above, it has a much nicer interface)
See my "Guide" on getting started in the Themes&Apps section for more adb stuff too..
Other alternatives for logcat directly on your phone are through Terminal Emulator (type su.. then logcat), or apps available on the Play Store (aLogcat, for example).
Hey I am just getting started with android dev. Have done just a few tutorials from the developers.android.com, so basically a noob at this. But I saw that Google recently launched the android studio for app developement. I was just getting started with eclipse, but the android studio looks more intuitive because of its better GUI. I'm bad at xml editing too So I think the interface of Android Studio would suit better. Is there anyone here who has tried both and knows the cons of abandoning eclipse IDE and going for Android Studio?
help
Hay friend i have downloaded Java JDK 6.0.45 & 6.0.07 & Java JRE 6,7 to But when i open eclips it shows me this error can you help me to get it solve
http://forum.xda-developers.com/showthread.php?t=2276871
http://forum.xda-developers.com/showthread.php?t=2227376&page=14
Do you know what path i use to upack the adt bundle i have unpacked it in almost every location on my computer and still nothing eclipes wont work nothing works plz let me know if you can help i really dont want to smash my new laptop that will be no2 in amonth if i do plz help

[Guide] Debian Kit & Limbo PC Emulator (QEMU x86) for Dual-booting Linux on Android

[Guide] Debian Kit & Limbo PC Emulator (QEMU x86) for Dual-booting Linux on Android
Note to mobile readers: view in light mode with XDA app (settings, near the top), view online with a browser (press menu and view online), or download google drive from the marketplace and follow the link to the main document in this guide, you should be prompted what to open that link with, choose google drive and you'll be greeted by an very friendly formatted and constantly updated guide. You can also check a box within the google drive app that allows you to view offline... and on with the show.Legend/Key/Guide for Guide
Yep that's happening. This is designed to avoid most questions about the excessive use of colour coding throughout the guide.
Orange text=chapter titles & section titles.
Yellow text=things that are partly under construction but complete enough to be used with caution
Red text=under construction and for education purposes only when used in the table of contents
Or
Red text=example command that should be modified based on system that you are running on before being used
Green text=complete aside from a missed or stray preposition.
Cyan text=text that can be copy/pasted into a terminal without any modification except for 2 cases
Cyan_text&Red_text=the red text should be modified for your system before use
# and $ should be ignored when copying as that symbol will already be on your terminal
Blue text=examples of what your terminal will output when using a supplied command. This is contextual to the guide and I try to include the command once in the document and a second time near the top of the dump.
Or
Blue text=when used in table of contents denotes things that likely are completely aside from making additions and are low on the priority list to update for the author of this guide.
Grey text=are full dumps of what a command should output and do without errors. These dumps have a reference pointer at the beginning of each so that you may find where in the guide they their relevant to
Pink text=when used in the table of contents this is to show what sections are completely new.
Note to mobile readers: view in light mode with XDA app (settings, near the top), view online with a browser (press menu and view online), or download Google drive from the marketplace and follow the link to the main document in this guide, you should be prompted what to open that link with, choose Google drive and you'll be greeted by an very friendly formatted and constantly updated guide. You can also check a box within the google drive app that allows you to view offline... and on with the show.
Link to Full Guide on google docs:
https://docs.google.com/document/d/1ssVeIhdBuuy8CtpBP1lWgUkG6fR6oHxP20ToYPPw6zI/edit?usp=sharing
Link back to XDA thread
http://forum.xda-developers.com/showthread.php?p=40434313#post40434313
Public Editable doc
https://docs.google.com/document/d/1CIkOT7iX62z8fpDckoYCw48UtIImjhzG6IJN6E6Qe2E/edit?usp=sharing
[Guide] Debian Kit & Limbo PC Emulator (QEMU x86) for Dual-booting and more
Draft2 Linux android multi-node cloud computer tutorial.
Contents
1.Setting up base system(functional/\under construction)​1:1 Updates (05202013) XDA Sync happening 8:30pm- added subsection 5:10. added descriptors to section 4:4:* Added/Completed two new mini guide to section 1:5:1:*{{XDA content sync happened 05182013} google document sync will happen after some time}
1:2 - Downloads for android device (functional)
1:3 - Installing Linux system to Android Device (functional)
1:3:1 Verify no major errors are present (functional)
1:3:2 Start ConnectBot (functional)
1:4 Manual install (functionally complete/partially under construction)
1:5 Other methods of running Linux alongside Android (All sub sections Under Construction)
1:5:1 Using Limbo PC Emulator (QEMU)
1:5:1:1 Apps & Files to download for QEMU
1:5:1:2 QEMU Linux Install Guide
1:5:1:3 QEMU Linux Setup Guide(new)(functional)
1:5:1:2-1 Method one: Install to virtual hard drive with QEMU(new)(functional)
1:5:1:2-2 Method two: use a computer to make a virtual install(new)(functional)
1:5:1:4 QEMU Integrating with the rest of Main guide
1:5:1:5 QEMU tips and tricks
1:5:2 Using Complete Linux Installer
1:5:2:1 Apps & Files to download for Complete Linux Installer
1:5:2:2 Complete Linux Installer Installer Guide
1:5:2:3 Complete Linux Installer Setup Guide
1:5:2:4 Complete Linux Installer Integrating with the rest of this guide
1:5:2:5 Complete Linux Installer tips and tricks
2.Installing additional packages​2:1 installing packages before devstack or openstack (Under Construction)
3. Setting up cloud system(Under Construction)
4. Additional notes and hints​4:0 Sites that have been exceptionally (updates contently)
4:1 apps for android that make things easier (functional)
4:2 linux software and or packages that I've tested (under construction)
4:3 commands for apt-get and others I've found useful (functional)
4:3:0 Android command line commands (new)
4:3:1 Apt-get commands (functional)
4:3:2 Command line commands for linux (functional)
4:3:3 Connectbot optimization guide (functional)(newly modified)
4:3:3-1. Linux Boot/Mount automation (newly modified)
4:3:3-2 Linux Un-mount/Kill automation (newly modified)
4:3:3-3. Connectbot “Local” SSH setup (newly modified)
4:3:3-4. Other good combos to use after using 'linuxBoot’ (newly modified)
4:3:4 Remote RDP debian kit guide (functional)
4:4 Rom Tool Box user Tips (brand new and no where else)
4:4:1 Scripts (new content)
4:4:2 Performance Mods (under construction)
4:4:3 General guidelines (under construction)
4:4:4 Useful tips (under construction)
5.Debugging\Known issues with solutions(Constant Construction:Completion Relative)​5:1 debian install problems
5:2 debian manual install issues
5:3 additional packages problems
5:4 reinstallation problems
5:5 How do I solve [My device/linux] issue(s)?(functional)
5:6 How to do a dump like the author?(functional)
5:7 Can I use this to completely replace my Android OS(new/\functional)
5:8 How do I add repositories to Debian?(new/under construction)
6.Introduction, Disclaimer, note to forum Moderator(functional)​6:1 Introduction
6:2 Disclaimer
6:3 Note to forum Moderator
6:4 Statement of long term goal for this project
6:5 Distillation of current project completion
7.Getting comfortable and customizing your new system​7:1 Connection Methods(under construction)(Mini-intro added)
7:1:1 Connecting locally
7:1:2-2.1 Connecting wirelessly through wifi(functional)
7:1:2-2.2 Remote RDP in from a second computer (New)(functional)
7:1:3 Connecting wirelessly through bluetooth(Mini-intro added)
7:1:4 Connecting wirelessly through data network
7:1:5 Connecting wirelessly through atana directly
7:1:6 Connecting through USB with computer
7:1:7 Connecting through USB with USB host mode
7:1:8 Connecting through visible light spectrum
7:1:9 Connecting though invisible light spectrum(New links added)
7:1:10 Connecting though directed/focused light
7:1:11 Connecting through audible sound
7:1:12 Connecting though inaudible sound
7:2 Customization of GUI(under construction)
7:2:1 Saving Electrons(functional)
7:2:2 Making it Pretty(functional)
7:3 Making things happen without excessive user input(under construction)
7:4 Methods of installing or unpacking(under construction)(New)
7:4-4. Installing from sources.(functional)(New)
7:4-4.1 Unpacking tar.gz files(functional)(New)
7:4-4.2 Installing Java for ARM from source(functional)(New)
7:4-4.3 Adding Commands to Bash(functional)(New)
7:4:4.1- Installing Map Tools(under construction)(New)
7:4:4:2 Solved Installing jMonkey on Android(functional)(New)
8.Sources of information and content(functional, nearly up to date)​8:2 Dumps I’ve taken and Pictures worth sharing (under construction)
8:2:1 example: installation without errors (complete)
8:2:2 Example of running fdisk -l (complete)
8:2:3 Example of running mk-debian (complete)
8:2:4 Example of the first time you run deb command (complete)
1:1 Updates
Here I’ll try to keep you up to date with where I am with this project. (Date) in the table of contents reflects the last time that I made a significant update to this guide. {notes} in the table of contents states the nature of the update, if the change is significant it will be referenced here so that you may find the modifications to the guide quicker.
UPDATES APPENDED: see Main Doc for full list of all updates.
05182013- manual install of java has issues with running '.jar' files from the command line, there seems to be another version or method to try or it may be a matter of downloading and applying new libraries to the java install itself, I'll be trying bothe (first the lib or dependency search) but will also end up doing a reinstall of the entire debian os again. Installing from source packages is very use at your own risk and running ontop of a rooted android which you've already been warned is use at your own risk; seems like it be risky, yep, but I've yet to re-root my device for what feels like 2 months (I tell you this because I believe the install instructions to be nearly complete and completely reliable) installing things after that seems hit and miss but so long as you're not foolish much of this guide elsewhere is safer than instructions found elsewhere.
Did some polishing of section 7 and added usefull links that I hinted in the past.
Moved section 6:6 Legend/Key/Guide for Guide to the top of the guide, mostly so I can keep the formatting consistent without loading back and forth between sections. Going to Update the XDA forum posts tonight, Google to google sync still pending...
05192013- Added some links to section 4. The commands in section 7 with red text in only one spot cannot be trusted and the commands right now are suspect right now, they'll be updated as I figure out what's wrong and this statement will be struck though. Java support with development tools and install instructions not far off now...in unrelated news, added new sections 1:5:* & 4:4:*, these right now are place holders for what is to come in the future, I'll be focused on the Java thing that's a bit weird on my system and wrapping up the install from source as well, just bouncing round the other places we'll go. Added new section with a little content; 4:3:0 Android command line commands, I'll be adding more as eventually I'd like to have linux tell android what to do and android to be able to do the same.
05202013- added new subsection to section 5:10 to help update answers to questions received through XDA. Added a bit of content to sections 4:4:* mostly intor fluff so I don't forget where I was going. Did some work for money so new content is still pending for the guide, will likely end up with more time tomorrow...
05212013- currently adding some content to 1:5:1, just couldn’t leave it alone added a bunch of content to that section... think I can call the two new guides functional for Limbo QEMU Linux Installation, comments welcome if it barfs on your device... so yeah made/completed a new section “7:4:4:2 Installing jMonkey” you can now install and run jMonkey naively on Android using Debian Kit and openjdk packages installed on your rooted phone or tablet, using directions in section ‘7:1:2-2.2 Remote RDP in from a second computer’ you can connect into it and develop on your Android device but with the full keyboard experience, then if ya need to go on the go you can save your work and reconnect locally on the device with directions from section ‘4:3:4 Remote RDP debian kit guide’ and continue your development project anywhere you’ve got time hope this helps game makers and app developers as this program outputs in formats that can then be run on the android side with full graphical bliss ... back to work on java compatibility?, looks like I might have to re-install Debian as I've mucked around in the system in a bad way but that's what the guide is for and I'll be working almost all day on the guide, check back often as content will be flowing in. XDA postings updated today 05212013 sorta, the character limit on XDA is now a limiting factor, I will split the document between posts for now and work on making the sections in the Google doc split correctly or something... Updates successful to all educational postings on XDA thread, google drive internal sync still pending but I've been at this for 14 hours or so today so I’ll be off my computer for a little while to let it cool down.
06122013- Section 3 nearly completed, script runs for installing cloud services to android but returns a few errors and is ready for others to test with me, send a PM, e-mail, Google+, what ever and I'll hook you (the reader) up with a preview of the draft script that I've been writing to install openstack to android. Still under heavy development and re-writing but should work now, I'll be posting the beta version publicly when I've done enough testing or had enough testers confirm that it works without problems.
________________
____Update: Bellow Link
____ https://docs.google.com/document/d/1A64GMgcVUKbZrTG2WDWfY_g9vABuRx78ULULu-Ir-kE/edit?usp=sharing
____is a script to be tested for controlling the Crazyflie Quad-Copter with Android using Debian Kit's Squeeze or others
____for now see Page 10 for the discussion related to this development.
____if found to work, then merging into the Main Guide and full description on how to get started will be included as well.
________________
Setting up base system (partially under construction)
Contents
1. Setting up base system:​
1:2 - Downloads for android device.
Debian kit
https://play.google.com/store/apps/details?id=org.dyndns.sven_ola.debian_kit
ConnectBot
https://play.google.com/store/apps/details?id=org.connectbot
Remote RDP free
https://play.google.com/store/apps/details?id=org.toremote.rdpdemo
Root browser (or use your prefered file browser)
https://play.google.com/store/apps/details?id=com.jrummy.root.browserfree
Hacker's Keyboard
https://play.google.com/store/apps/details?id=org.pocketworkstation.pckeyboard
debian-kit-1-5.shar
http://sven-ola.dyndns.org/repo/
1:3 - Installing Linux system to Android Device
1:3:1 Verify no major errors are present
Open Debian Kit: check that there are no red X's; tap on anything in the list for more info and/or press menu and tap read me for the developers original doc.
Check that you've enough memory: from the home screen press menu and tap settings; Scroll down to application settings, tap it and view storage use; try to have as much available memory as possible by, moving/removing apps, ruffly 100MB+ worked for me. Note after the initial install you should be able to reinstall/restore the removed apps with little ill effect.
Remove data consuming tasks from the equation either by freezing them with an app like rom tool box or turning off their sync options or uninstalling them. Mainly this step helps insure that while you're downloading the necessary data that your connection doesn't flip out and cause an error that could have been avoided.
1:3:2 Start ConnectBot (rom toolbox terminal emulator also works well for this part with some modification)
Tap on the lower left corner where ssh button is and select local instead.
Tap in the text field next to the bottom now displaying local and type in a nickname like 'debInstall', hit enter and be presented with-
$
Type su, hit enter, and permit superuser permissions.
$ su
#
Unpack the installer with sh /sdcard/download/debian-kit-* note: if downloaded with dolphin browser or some other browser then you'll need to change the file path to reflect that.
# sh /sdcard/download/debian-kit-*
Or
# sh /sdcard/Dolphin_Browser_Mini/download/debian-kit-*
Or
# sh /mnt/sdcard/download/debian-kit-*
See 8:2:1 for example of what your screen should look like without errors.
Choose your path:
Input 2s will install a debian.img file 2gb in size to your sdcard. Note: this option is suggested as for the first try as this will allow for a stable and fairly sized environment to test and play with, furthermore I will be writing this guide first for the debian squeeze option and later add the others as I've the time. If choosing this option scroll down to step 6. when the installer starts asking questions.
If 2gb sounds to small and you're willing to brave the manual install, then you'll want to abort the auto installer at this point and scroll further to step 1:2 Manual Install
Once the install has finished you'll be given three options yes, ovpn, q choose one and only one. When yes or ovpn is used things will be removed, when q is used the debian image is unmounted just as it will be automatically unmounted at the end of either yes or ovpn option. Note: when I install to debian.img file I choose ovpn as this allows for the most amount of space to be freed.
Now providing everything is error free the debian.img can be remounted with either of the two commands
# deb
or
# /data/local/deb/deb
Note: to see what it will look like the first time you run deb and not encounter errors see section 8:2:4
Now to first
update the list of packages currently installed,
second upgrade everything,
third install andromize for compatibility,
forth install andromize-lxde for a gui,
fifth install ssh,
sixth auto remove unnecessary packages,
seventh clean up,
and all that in one step that will take more than a few minutes to complete. Note: andromize at some point is going to request input from you;
tap on your screen and tap on the control button that briefly shows up in the lower corner, the hit the 'i' button on either you hard keyboard or onscreen keyboard. This will put you in insert mode so that with a d-pad and the spacebar or enter key you can select a highlighted option, I suggest: ctrl+i then space (or enter) as that has worked everytime for me.
# apt-get update; apt-get upgrade; apt-get install andromize; apt-get install andromize-lxde; apt-get install openssh-server; apt-get autoremove; apt-get clean
So you're set to rock and roll as root and have a lot of options if ya know what you're doing.
At some point with all this you may feel uncomfortable with running under sudo root user. Scroll down to '4:3:2 Command line commands for linux' and run those commands to secure yourself some.
Start your new ssh server. Now that the basic requirements to run linux have been met and you've a clean OS we need a way to 'open and 'close' terminal windows that aren't going to remount the system a bunch or run us into out of memory or space errors.
Start ssh with one of the following commands
# deb s
Stop ssh with one of the following commands (when you're done)
# deb S
Once ssh is on you can connect to your device from any other ssh compatible device. For now we are going to use identical directions, almost, to section 4:3:3-3
Make or open a new or existing ssh connection with connectbot with your username that you want to log in as then the @ symbol followed by "localhost"
Make sure that in the lower corner that the option is set to ssh and hit the enter key
Connectbot or whatever local running ssh app you're using (I'll be testing or hearing about a few I'm sure) should now prompt you for a password. Put in the one you (I hope setup before in step 4:3:2... yeah I'm going to have to fix that...) set up and you should be greeted by a few lines of text and a # with your username before it. This is where many of the linux commands should be run.
Note: this method is prefered because you can connect and disconnect without sending multiple "deb" commands in the local connection that we only should use for installation and starting the system (first boot and after reboots). Sending multiple "deb" commands can cause all sorts of issues without sending "deb u; deb k" commands between. The other issue that arises with sending multiple "deb" commands followed by a "deb u; deb k" is that you can fill folder structures on the linux OS and your SD card that are designed to rescue unintentionally deleted files, cache, and junk files, which in other circumstances is really good to know like when a picture disappears from your gallery, but in this case is a real pain. You'll get all sorts of errors so remember one "deb" command per boot and connect through ssh or remote RDP once your system has mounted linux and you'll have a happier experience. Okay moving on.
1:4 Manual install
Unmount and eject the sd card from your device
Plug the sd card into enough adapters to plug it into your computer. I've used micro to sd adapters and then plugged that into yet another adapter sd to usb with success.
Backup all data. You're about to delete it all.
Using gParted on ubuntu 12.04
Ensure that gParted has selected the sdcard and not your hard drive... don't select your hard drive that would be bad.
Check out the current partition layout, perhaps even make note of it somewhere incase something goes wrong. My sandisk started out with a 4mb empty zone and a fat32 partition for the rest.
Reformat original partition to fat32 by either write clicking the main partition or selecting the partition drop down menu at the top of the window.
Resize first first partition (pay close attention to not accidently remove, overwrite, or move over the little bit reserved at the start of your sdcard) to the desired amount of space for the android side of your device such as space for; downloads, app cache, apps to sd, photos, and music. This space is all that my android recognizes by default so think about it.
Second make a second partition filling up the trailing bit left over, you can try something fancy but I chose a fat 32 bootable.
Apply the three operations with the green checkbox in the upper left quadrant of the window and let it run.
When gParted finishes unmount and eject the sd card, wait a second or two and plug it all back into your computer.
If you left gParted open then your sdcard and it's partitions should now show up as selectable in the drop down for devices. Close gParted.
Open a file browser or two; one for your sd card's first partition and another for where you saved the backup of your sd card's contents.
Copy your backups back over to the first partition of your sdcard. I'd advise copying the important things first, app backups folders and system and/or nandroid backups. The things you can live without for a day or two you can come back for because you're here to get to the next step.
Unmount and eject from computer. Plug back into phone and remount.
Run through the first part of the guide and about when given the option to make a debian.img file.
Run the following commands in connectbot under superuser to figure out what the installer uses to identify the second partition on your external sdcard, format it and install linux to it.
This may show the uuid, drive letter, date modified. Make note of todays date and check for three dates in the list that match from when you were repartitioning. Take note of everything.
/data/local/deb/armel/busybox fdisk -l /dev/block/vold/*
Results may vary try navigation to /dev/ with a root browser on the android side of things, take a look around and adjust the bit after 'fdisk -l' to reflect your device's folder scheme and rerun till you get something that looks like this: (or see section 8:2:2 for full example)
Device Boot Start End Blocks Id System
/dev/block/vold/179:0p1 1 1279 10264576 c Win95 FAT32 (LBA)
/dev/block/vold/179:0p2 1279 1925 5189632 b Win95 FAT32
Now to run the mk-debian -h script and change settings until satisfied. Note: I had one issue when I didn't tell the installer what 'drive' letter to install to;the letter preceding 'Win95 FAT32' in above example or in the below example command you can see the drive letter delineation specified at the end with '-L b' because on my device setup that's the letter in which I need to install to. (see section 8:2:3)
# /data/local/deb/mk-debian -i /dev/block/vold/179:2 -s 5310 -L b -h
Which if configured correctly will look like the dump took and pasted below.
Script to format a loop disk file or disk partition with ext2/3/4 and install a Debian Linux there.
Usage:
mk-debian [Options]
Options:
-d <distro> specify squeeze/lucid/precise
-m <path> specify mount point for disk/device
-s <megabyte> specify size for new loop disk file
-i <file|dev> specify loop disk file name or device
-t <ext2/3/4> specify file system to be created
-L <label> specify disk label for formatting
-D <ip> specify DNS server to be used
-M <url> specify Mirror URL for downloading
-u update /system/bin/deb script and exit
-U uninstall Debian kit (not debian.img!)
-C clean files not required to run Debian
-h display usage text and settings
Settings:
-d squeeze
-m /data/local/mnt
-s 5310 Mb
-i /dev/block/vold/179:2
-t ext4
-L b
-D 8.8.8.8
-M(squeeze) http://ftp.de.debian.org/debian
-M(lucid/precise) http://ports.ubuntu.com/ubuntu-ports
Action: install
Notes:
For creating a loop disk file, you may want to change the default size (in Mb, 512-2047). For formatting a device (-i /dev/xxx) or if overwriting an existing loop disk file, the size is ignored. The loop disk file name or the device name will be written to the bootdeb script's IMG= line if this script succeeds.
If you specify a device, the UUID of the formatted device is instead saved into bootdeb (IMG=uuid:<hexid>). With this, the correct device can be found even after some mixed USB drive/SD card eject-insert sequences.
Check your settings by adding '-h' as the last switch.
Remove the '-h' from the tail end of the command to run when you believe all is good and if all is good then scroll back up to step 7 of the main install guide where it talks about remounting debian.
1:5 Other methods of running Linux alongside Android
Contents​_______SPLIT FOR POSTINGS______
1:5 Other methods of running Linux alongside Android​These sections that follow ( 1:5:* ) will detail the other methods the author has installed Linux Environment.
Note: at this point I've only one device that is capable of developing a guide to install and integrate cloud services; if you wish to see that change you may make additions on the publicly editable version of this document, or, research it on your own time, or, make a donation to the author; my time can be purchased , or, wait for me to document it in my own time.
1:5:1 Using Limbo PC Emulator (QEMU)​Note: I did not originally include this method as it is a slower way to run linux on android. Its good but emulation always comes at a cost. There are many devices on the market now that will support this app smoothly but like I've said you'll still see a cost.
Note: run-on list of “Cost”
Slow: The nature of emulation causes this. To understand the details of this one will have to delve into some of the details of how machines talk to one another and within themselves, machine language(s), and, the details of what a processor actually does.
I’ll try to sum it up though; a processor type (CPU - ARM/Pentium/AMD and even GPU - Nvidia, iSBX 275, S3 89C911) has a specific structure in how the components and pathways are laid out. This causes each manufacturer to have their own way of sending electrons across the internal structure that makes up the processor, this is usually kept private or proprietary (Xbox, Playstation, Nintendo are good examples of this) to the manufacture, which is the machine language that I was talking about. Compatibility with the other components that the processor connects to is usually achieved by standardization of “shape” meaning the little wires that come off of CPU chip itself and connect to the rest of the circuit board, and the internal firmware of the CPU chip.
To make a processor process a “native” task one must be speaking its language or a language that it understands (many come with what’s called ‘channels’ that handle; Flash, Java, or other human readable programming language) and tell it where to get information and how to handle it and where to send it and what to do next and have all that on the “native” hardware. To make a processor process a “alien” task one must have a way of translating all the processor’s calls for data and handling of data to a completely different set of physical pathways and methods of handling data; this would be like if you and I were placed in completely different parts of the same city and were given the exact same set of instructions (north 5 kilometers, east 12 meters, south east 1 kilometers) and be expected to arrive at the same location; just doesn’t compute, you would end up in a location relative to your start point just as I would but the relative distance wouldn’t change between us. And more than likely one of us would run into an obstacle not far from the start and where we programs and not humans the one of us to hit an obstacle would, like a lemming, just keep failing until killed off.
An emulator bridges the language and hardware divide (visual here: like an octopus wriggling through a small hole when viewed through x ray photography) by wrapping up the data being handled in such a way that another processor doesn’t try to natively run the data being wrapped up (visual here: like the internal organs, of the before mentioned imaginary octopus, not rupturing through the skin and spilling out into the water that it’s entire body is encapsulated in) and then giving the data within a way to communicate with other data that has been wrapped up.
It's not an exact description of emulation but an analogy and how I think about it.
Electron Expensive: The very act of emulation causes the processor that is running the emulation to pull double duty. For every task that has to be carried out by the emulated machine. a task must first be started on the host machine, then the emulated task is started, then the emulated task makes a call for more data or tries to write data, that emulated task ‘call for more’ is sent back to the host machine, the host machine then must make the required translations to compute the request, after computing the request the task is performed, if the task being performed makes ‘calls for more’ then those are then handled just like the parent task (making more calls and translations back and forth) and so on. When done coded properly; emulators can emulate a processor very near the host’s megahertz level and the emulated tasks show very little lag from all this back and forth that the data must first go through, however, due to the closed source nature of hardware and internal firmware, making a well coded emulator is very difficult and usually involves trial and error combined with a little reverse engineering. In most cases when running an emulator, you’ll want a host machine capable of much greater megahertz range than the machine you are trying to emulate (it’s why next gen console emulation is so difficult for most home PC’s) to allow for the back and forth that happens with emulation. This back and forth that the data goes through is what will cost you in battery life because data is transmitted with electricity and there is a finite amount that your battery will store and output.
Hair Puller: As wonderful as it can be to run emulators; eventually things just go wrong and debugging how to work around it can be an exercise in futility.
Note: run-on list of “Benefits”
Extended Compatibility: Being able to run non-native machine code and system tasks gives an enormous amount of flexibility to the host machine. With QEMU you can even emulate the old floppy disk drives on Android and I doubt most households have a fiscal one of those anymore.
Development Options: Emulating hardware allows for development to take place on a set of hardware that doesn’t need to be physically owned thus reducing the cost of development to time, education, and workforce.
Hardware Virtualization:Because the operating system is running on virtualized hardware you are more free to convert the image file that the OS is saved to and run on multiple devices or computers with very little work once you’ve got an installed OS image. I’ve even seen work done to sync system files between clones so that one can login to each clone and after a few minutes have the exact same programs to access and run between devices.
Games:Yep you can play games with this, like mine sweeper and other low memory intensive games, but further development and a faster device will alow for many more titles to be added to the list of “working and fun” that I’ll be compiling here.
1:5:1:1 Apps & Files to download for QEMU​Limbo from the Google Marketplace
https://play.google.com/store/apps/details?id=com.max2idea.android.limbo.main
Limbo in my opinion is of the one of the best apps out there for novice on up to master rooted phone users. In short its like a "game console" emulator for your pc only with a big twist the "game console" Limbo emulates is actually normal PC processors like a pentium 3 and it runs on android so you can play pc hardware dependent content such as windows if you've got the specs on the go.
Pick A Linux Distribution
The links provided are here for convenience and should be considered untested unless accompanied by a statement that it has worked on android. I will try to test as many as possible and document the; pros and cons; methods of installation if they varied from the main QEMU install guide provided in this main guide.
DSL (Damn Small Linux)
http://www.damnsmalllinux.org/download.html
Worked for me on my Epic 4Gs
Ubuntu (12.04)
http://www.ubuntu.com/download
Kali (like backtrack)
http://www.kali.org/downloads/
There is a live boot ISO for PC, a ARM variant that’s being tested by others, and a network install that I’ve found. For this method (QEMU) I would suggest the PC version; I’ll be testing the network install in the future so I can attempt a “Debian Kit” port for the ARM native version of their distribution.
Backtrack
http://www.backtrack-linux.org/downloads/
Android-x86
http://code.google.com/p/android-x86/downloads/detail?name=android-x86-2.2-generic.iso&can=2&q=
Just ran across this one. It’s android for PC processors instead of the ARM processor. But QEMU is a PC emulator, so if we want a slow Android OS running on top of the normal one for that could be possible. Don’t know yet if it will work but it’s worth a shot as this would allow developers to mobily develop for this variant of Android and normal root users the chance to make drastic changes to the emulated Android environment without too much fear of fouling up their main Android environment.
1:5:1:2 QEMU Linux Install Guide​1:5:1:2-1 Method one: Install to virtual hard drive with QEMU
1. Download Limbo from the market place
2. Download a Linux distro to start with or try an ISO that you already have if you're feeling adventurous
3. Open Limbo
4. Tap on ‘Load VM’ and choose ‘New’
5. Name your new Virtual Machine and tap ‘Create’
6. Scroll down to ‘RAM Memory (MB)’ tap ‘64’ and choose 512
7. Scroll down to ‘CDROM (*.iso)’ and tap ‘None’
8. Tap ‘Open’ in the new pop up and using the folder navigation window that pops up; navigate the the ISO file that is on your device (usually in your downloads folder) and tap it
9. Back in the main Limbo app screen scroll down to ‘Hard Disk A(*.img/*.qcow2)’ and tap ‘None’ and tap new
10. In the new pop up (Image Name) title your hard disk somthing that will tell you that it’s an emulated hard drive of that distribution, such as ‘DSLhdEmu’ and set a size that you’re willing to sacrifice to running Linux and tap ‘Create’
11. Scroll down to ‘Boot from Device’ tap ‘Default’ and in the pop up choose ‘CD Rom’
12. Scroll down to ‘Network Configuration’ and tap ‘None’ and choose ‘User’
13. Scroll down to ‘VGA Configuration’ tap std and choose ‘vmware’
14. Scroll up, all the way up, on the Limbo main screen and choose start. If everything goes well you’ll be presented with a linux live boot environment that you can then use to install onto the virtual hard drive that you made. Once you install you can remove the ISO from the parameters in Limb and change the boot order to the virtual hard drive.
1:5:1:2-2 Method two: use a computer to make a virtual install
and then converting it to a qcow2 file and install linux to it before moving it over to the device to run it. This is a bit round about but it's my method when I can't run the install but can run the OS due to emulation not being perfect and my device not being powerful enough.
1. Download and install ‘VertualBox’ to your PC from:
https://www.virtualbox.org/wiki/Downloads
Note: You’ll want to choose the one that is for your PC’s hardware and operating system
2. Open ‘Oracle VM VirtualBox Manager’ and click ‘New’
3. Click ‘Next’ and title it something you’ll remember is for this purpose, such as ‘DSLforQEMU’
4. Mouse over to ‘Operating System’ and click on ‘Microsoft Windows’ choose ‘Linux’ in the drop down
5. Mouse over to ‘Version’ and click on ‘Ubuntu’ choose ‘Other Linux’ in the drop down
6. Mouse over to the ‘Next’ button and click it
7. Mouse over to the box with ‘256’ click it and input 512; mouse over to next and click it (unless you’re computer has less than 2 gigs of RAM)
8. Click the ‘Next’ button again because we’re creating a new ‘Start-up Disk’
9. Mouse over to the ‘VHD (Virtual Hard Disk)’ and click the little circle next to it to select that option and mouse over to the ‘Next’ button and click it
10. Click the ‘Next’ button again unless you really want a ‘Fixed size’ image taking up a bunch of space or if you’ve had issues with ‘Dynamically allocated’ option not converting to qcow2 format properly.
11. This next page titled ‘Virtual disk file location and size’ you’ll want to set up yourself based on how much space your hard drive has and how much space your Android device has. I shrank mine down to 3 gigs though and left everything else alone.
12. Mouse over to the ‘Next’ button and click it then ensure everything looks ok and click the ‘Create’ button too. If there is a second window behind that go ahead and click the ‘Next’ and ‘Create’ buttons too to set up the virtual machine
13. Mouse over to the new virtual machine that you’ve created and ‘right click’ it and select settings or select the new virtual machine and select the ‘Settings’ button which should be between the ‘New’ and ‘Start’ buttons
14. In the new ‘Settings’ window, you’ll find oodles of things to tweak and feel free at a latter time, for now mouse over to the ‘Storage’ and click it
15. In the storage settings mouse over to the ‘Storage Tree’ part of the window and look for a disk icon that says ‘Empty’ and select it (this is the virtual machine's CD drive)
14. With the virtual CD drive selected mouse over to the ‘Attributes’ part of the window and select the checkbox to enable ‘Live CD/DVD’, mouse over to the disk icon just to the right and a little above the checkbox and click it to set up where the ISO is for installing Linux, select ‘Choose a virtual CD/DVD file...’
15. Use the new window titled ‘Choose a virtual CD/DVD file’ to navigate and select the ISO file that you wish to use to install Linux to the virtual hard drive image that was created in step 11
16. Mouse over to the ‘Open’ button and click it then click the ‘Ok’ button in the ‘Settings’ window that was behind it.
17. Back in the main window for VirtualBox titled ‘Oracle VM VirtualBox Manager’ ensure that the virtual machine that we’ve been making is still selected and then mouse over to the ‘Start’ button and click it.
18. Interrupt the boot with one of the function buttons on your keyboard when the new window pops up and starts to paint in what will look like a computer starting up in a window (usually ‘F2’ or ‘F10’ or ‘F12’)
19. In the interrupted boot menu within the “VM” window choose the option that corresponds with the CD drive to make the virtual machine boot from CD this time around only
20. Let the live boot process process for a bit and eventually you should be presented with a window that looks like a linux desktop is inside of it
21. Follow the instructions for installing your specific distribution to a hard drive and when that guide states to install to a hard drive just remember to be selecting the virtual hard drive that was created in step 11
22. After installation to the virtual hard drive has finished test that it installed correctly by shutting down the virtual machine and getting back into the settings described in step 15 and “eject or remove or unmount” the linux ISO file from the virtual CD drive
23. Start the virtual machine again and check that it boots correctly from the virtual hard drive image. If it does shut it down again properly. If it doesn’t try again or try a different distribution.
24. Open the ‘Settings’ window again and select ‘Storage’ again, this time though under the ‘Storage Tree’ part of the window select the virtual hard drive image (its the *.vdi file that was created in step 11) and mouse over to the disks icon to in the ‘Attributes’ part of the window to the far right of where it says ‘Hard Disk’ and select ‘Choose a virtual hard disk file...’ and make a note of the full folder path to the *.vdi file; somewhere like in a notepad or scrap of paper or memorize it.
25. Open a terminal window on your PC and convert the *.vdi file to a *.qcow2 file with the following command structure
Example : Syntax
# qemu-img convert -O qcow2 *.vdi *.qcow2
Example : useable
# cd /home/dev/dumps
# qemu-img convert -O qcow2 DSLforQEMU.vdi DSLforQEMU.qcow2
26. Let the converter convert and come back to it after a few minutes
27. Once the converter has converted it’s time to transfer the qcow2 file to your Android device, use a cable or a SD card adapter to get it over to the folder that Limbo saves virtual hard drive
28. Start up Limbo and create a new machine much like the steps in method one but you’ll not need to select a ISO file, instead select the virtual hard drive image as the hard drive to boot from and set the other setting the same as method one and start the virtual machine to test it on your Android device.
2. Installing additional packages & 3. Setting up cloud system
Contents​2. Installing additional packages
These packages should be installed if you’re following the entire guide for setting up a wireless private mobile cloud server. At this point the author is still debugging error messages with some of the services/packages that are being trialled for this making this project a reality and the author is still working on educating himself on dependencies/configurations; so use section 2 and section 3 use at your own risk.
2:1 installing packages before devstack or openstack
First we'll need some git for our flavor of debian
#apt-get install git-arch
Devstack.org directs to use the following comand to get a clone of devstack onto your device
#git clone https://github.com/openstack-dev/devstack.git
Then to deploy and install use
#cd devstack && ./stack.sh
Debian has got some errors so I'll have to figure out where to go from here. Resources that I'm using:
devstack.org compatible with ubuntu 12.04 form of debian kit posibly, still working out kinky install errors with ubuntu on myTouch 3g.
openstack.org states that its compatible with debain and ubuntu forms of debain kit posibly, still reading and obsorbing information. Could run into processor, memory, and storage constraints if the guides are to be believed, don't care round hole meet square pag.
stackgeek.com/guides/gettingstarted.html ran accross it, might have something...
Google.com yep google gets it done with well constructed quaries. Use the 'solved' 'distro' with 'issue' and refine from there, adding 'similarweb address) or (something)' or 'siteweb address specifically)'
Contents​3. Setting up cloud system
This is under construction...
Note: looks like you'll need access to a total of three devices for this; be it three rooted android phones or a combo of computers and rooted devices all of which seem to at this point need to be running Ubuntu 12.04 LTS.
I'm now looking into installing the componits that are required to run openstack on Ubuntu to other distrobutions such as Squeeze by downloading the sorce .deb or .sh files and installing from sorce. This is because after reading though the bootdeb (wich you can find after unpacking the debian kit under the file path: /data/local/deb/bootdeb) by opening as a text file with rom toolbox; there seems to be a way of shifting the way that super user requests are handeled by the android system that alow for devices (such as the myTouch 3g) with system read/write protection enabled (sOff/sOn) to handle read/write permitions diferently. This has adverse side effects so avoiding it and using a stable reliece of debian squeeze is the sogested method at this point and fixing the depindencies manuely.
Un-orginized notes
What dependencies or pacages that shold be satisfide
Info taken and used from
http://openstack.dachary.org/2013-02-20/
keystone nova glance nova-network cinder
and it does not include
horizon quantum ceilometer
4. Aditinal notes Part 1
Contents​4. Additional notes
The following sub sections are dedicated to the more common tasks: interacting with android linux as a whole, helpful links, linux command line commands, and helpful tips for the apps that you’ll be using to set up and interact with your linux android system that would have broken the flow of reading the main install steps.
4:0 Sites that have been exceptionally helpful
This section has the following organization patterns:
new links = descending order, older links near the top newer links towards the bottom
small font with link embedded = older links that likely are up to date between all versions of this guide
medium font with link embedded = links that I’ve formatted but have yet to update to other mirrors of this guide
medium font with link not embedded = links that I’ve most recently added and likely have not been updated anywhere else
https://github.com/openstack-dev/
http://blog.urfix.com/25-ssh-commands-tricks/
http://www.linuxquestions.org/questions/debian-26/how-to-configure-apt-get-to-install-suggested-packages-169746/
http://www.linuxfromscratch.org/blfs/view/svn/index.html
https://help.ubuntu.com/community/AptGet/Howto
http://forums.debian.net/viewtopic.php?f=30&t=47258
http://www.howtogeek.com/108511/how-to-work-with-the-network-from-the-linux-terminal-11-commands-you-need-to-know/
http://www.verot.net/socks.htm
http://cssoss.files.wordpress.com/2012/05/openstackbookv3-0_csscorp2.pdf
http://docs.openstack.org/trunk/openstack-compute/admin/content/installing-openstack-compute-on-debian.html
https://wiki.openstack.org/wiki/Packaging/Debian
http://wiki.opscode.com/display/chef/Deploying+OpenStack+with+Chef
http://anonscm.debian.org/gitweb/?p=openstack/glance.git;a=summary
http://www.debianuserforums.org/viewtopic.php?f=9&t=1513
http://www.wikihow.com/Run-a-.Jar-Java-File
http://linux.die.net/man/1/mr
http://wiki.debian.org/BridgeNetworkConnections
http://www.oracle.com/technetwork/java/embedded/downloads/javase/index.html
http://ss64.com/bash/
http://www.bleepingcomputer.com/forums/t/145051/making-your-own-linux-bash-commands/
http://answers.oreilly.com/topic/1442-how-to-configure-windows-7-remote-desktop/
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=81&t=27634
https://jdk8.java.net/fxarmpreview/
http://www.savagehomeautomation.com/pi-jdk
https://jdk8.java.net/fxarmpreview/javafx-arm-developer-preview.html
http://linuxconfig.org/bash-scripting-tutorial
http://developer.android.com/reference/android/content/Intent.html#ACTION_SHUTDOWN
http://en.wikibooks.org/wiki/QEMU/Images#Converting_image_formats
http://www.penguintutor.com/tutorials/viewdoc.php?doc=bluetooth-network-tutorial
4:1 apps for android that make things easier
Note: these apps are not necessary to follow the guide as of yet, so don’t go paying without considering all the good it’ll do you.
GitHub
https://play.google.com/store/apps/details?id=com.github.mobile
ROM Toolbox Pro
https://play.google.com/store/apps/details?id=com.jrummy.liberty.toolboxpro
XDA Developers
https://play.google.com/store/apps/details?id=com.quoord.tapatalkxda.activity
devcheats
https://play.google.com/store/apps/details?id=miquelco.devcheats
Shark for Root(native)
https://play.google.com/store/apps/details?id=lv.n3o.sharknative
BusyBox Installer
https://play.google.com/store/apps/details?id=com.jrummy.busybox.installer
Remount
https://play.google.com/store/apps/details?id=com.stericson.remount
TUN.ko Installer
https://play.google.com/store/apps/details?id=com.aed.tun.installer
Google Drive
https://play.google.com/store/apps/details?id=com.google.android.apps.docs
4:2 linux software and or packages that I've tested
jMonkeyEngine
http://jmonkeyengine.org/
Very powerful programing and development toolkit for programing, if you run into issues after installation go to help update in the jmonkey window and that should resolve it, the developer states it on the download page but i and many others have filled google search bars with error searchs when mostly that one step will save you a lot of heartache, after of course resolving the other dependencies... I’ll be updating this in a bit with full directions on how to install .sh packages from the downloads folder in android to a full programing environment.
Wireshark (linux & android? yep)
http://www.wireshark.org/
updates eventually. so far I’ve been able to use wireshark from the android market to capture my home network info’s, saved it and then using wireshark on the linux side of things to view and interact with the pcap files as I at this moment don’t know how to resolve all the dependencies for running wireshark on the linux side solely.
4:3 commands for apt-get and others I've found useful
4:3:0 Android command line commands
Here will be commands that can be run from the Android command line, independent of the Linux system, some in fact many will also work on the Linux system. At this point the "____" will be the break between subsections for sectio 4:3:0:* as organization will have to happen after there's enough content to organize.
____
Download from web to a specific directory and attempt to reconnect if connection is interrupted.
The -cO = 'c' to reconnect if interrupted, 'O' to 'output' to a specific file path.
The '/sdcard/Download*' = path you want to save the file to; adjust it based on where your device saves downloads to by default or change it to a custom path.
The 'http://' = the web address you wish to download from. Some may not support it but most should.
Example : Syntax
# wget -cO /sdcard/Download/[Name-of-file-you-are-downloading].[file-extention-of-the-file] "http://domain.com/path/to/file/to/download.zip"
Example : Usable
# wget -cO /sdcard/Dolphin_Browser_Mini/download/photobomb-cat1fxb.jpg " http://www.justsaypictures.com/images/photobomb-cat-1fxb.jpg "
____
4:3:1 Apt-get commands:
Search for package or package description (still working on condensing and organizing this part)
#apt-cache search "web server"| grep something
Install commands
#apt-get -i {package-name}
Removal commands
#apt-get remove <package_name>
Removes an installed package, leaving configuration files intact.
# apt-get purge <package_name>
This command completely removes a package and the associated configuration files. Configuration files residing in ~ are not usually affected by this command.
If you want to remove package1 and install package2 in one step:
# apt-get remove<package1> <package2>+
Remove unnecessary or abandoned data that isn't necessary to keep
# apt-get autoremove
This command removes packages that were installed by other packages and are no longer needed.
#apt-get autoremove <package_name>
This command removes an installed package and dependencies.
While there is no built in way to remove all of your configuration information from your removed packages you can remove all configuration data from every removed package with the following command.
# dpkg -l | grep '^rc' | awk '{print $2}' | xargs dpkg --purge
auto-apt commands
# auto-apt run<command_string>
When invoked, the auto-apt command automatically installs packages upon missing file access. If a program tries to access a file known to belong in an uninstalled package, auto-apt will install that package using apt-get. This feature requires apt and sudo to work.
Auto-apt keeps databases which need to be kept up-to-date in order for it to be effective. This is achieved by calling the commands auto-apt update, auto-apt updatedb and auto-apt update-local.
Usage example
You're compiling a program and, all of a sudden, there's an error because it needs a file you don't have. The program auto-apt asks you to install packages if they're needed, stopping the relevant process and continuing once the package is installed.
# auto-apt run./configure
It will then ask to install the needed packages and call apt-get automatically. If you're running X, a graphical interface will replace the default text interface.
dpkg command to get package information such as description of package, version etc. The syntax is: dpkg --info {.deb-package-name}
Pull up the man page for adding repos to apt-get
# man add-apt-repository
Note: at this point this command doesn't work, will look into it at some point soon.
At some point if you don’t know better you’re going to try and make apt-get install more automatically than it really needs to; you may succeed. Before you waste your time like I did and then go searching round for ways to undo safely the same way take a look at this quoted and condenced from hear (http://www.linuxquestions.org/questions/debian-26/how-to-configure-apt-get-to-install-suggested-packages-169746/)
::::::
I think that automatically adding all suggested packages would put a lot of cruft on your system. However, if you want it, you can get that behavior by adding a line to /etc/apt/apt.conf: Code: APT::Install-Recommends "true"; APT::Install-Suggests "true";
The second line will automate suggests and the first would automate installation of recommends. You can use either or both, though again, lots of cruft. If you don't yet have an /etc/apt/apt.conf file,you can create it and add just the one line.
If you have apt.conf setup like this, you can avoid installing recommends via: Code: apt-get --no-install-recommends install package
This will prevent apt from considering recommended packages as dependency for installing,even if apt.conf is configured to do so via "APT::Install-Recommends".
you can also specify the option on the command line, like this: sudo apt-get install <package> -o APT::Install-Suggests=true but apt-get install will follow the "suggests" for all installed packages, not just the one you are adding now.
::::::
____Split
4:3:2 Command line commands for Linux (part 2)
4:3:2 Command line commands for Linux
Set password for root
# passwd
Add a normal user. This command will also start a chain of user input requests to set up the user's "profile" its easy and better than running round as root all day.
# add-user[new-user-name]
Or
# adduser[new-user-name]
Give normal user sudo permissions. Note depending on which environment you run this command you will need a password for root or the user's password for the sudo permissions or the password for the user, try'em all till one works and make a note of it.
# add-user sudo[user-name]
I've also used
# adduser [user-name] sudo
Login to new user. It will then request a password from you. Note when you type in your password there will be no indication on your display, this is a security feature.
# login[user-name]
Install packages to new user once logged in
#sudo apt-get install [package-name]
Get a list of installed packages
#dpkg --get-selections
Get some help with dpkg
#dpkg --help
4:3:3 Connectbot optimization guide
By this point I hope you've poked around in Connectbot and seen some things. We're going to use some of them here to make the boot and shutdown processes a bit easier. For theses steps you’ll want to follow steps 4:3:3-1 though 4:3:3-4 and then scroll down to the specific automation example and copy/paste it.
4:3:3-1. Linux Boot/Mount automation
Open Connectbot
Make a new local connection and title it 'linuxBoot' or something that will remind you not to open it more than once (if you do, don't worry, we can fix it)
Disconnect from 'linuxBoot' and then press and hold on it until a dialog pops up.
Select Edit Host, scroll down to ‘Post-login automation’ and select that too.
Past the following lines with the line breaks intact (you may have to go in with your finger and hit 'enter' in order to have the correct line breaks between commands) if your device took well to the system shortcut that the installer attempted to place for 'deb'.
su
deb s; deb x
Past the the following if you get errors saying that 'deb isn't recognized'. This is usually to do with not having full read/write permissions while your device is operating (sOff and sOn for example on some HTC devices)
su
export PATH=/data/local/deb:$PATH
deb s; deb x
The deb s causes linux to mount and start openssh-server so that you can connect to it from any ssh compatible device and get to the command line.
The deb x starts up lxde, which gives you a graphical user interface to interface with.
The export path command is kinda like a short cut. You can use that one for many things and is well worth experimenting with.
Save your settings by hitting 'ok' and backing out to connect bot's main screen.
Make a new local connection and title it something like 'linuxShutdown'
Repeat steps 3-5 or 6 and past one of the following
4:3:3-2 Linux Unmount/Kill automation
Paste the following lines into the separate new local connection’s ‘Post-login automation’ titled ‘linuxShutdown’ for a quick connection that you can use to safely shut down your connections, unmount the OS from where it hooks into the android system, and kill any remaining tasks.
su
deb S; deb X; deb u; deb k
Or
su
export PATH=/data/local/deb:$PATH
deb S; deb X; deb u; deb k
capitalizing the 's' and 'x' from the 'linuxBoot' example sends the shutdown command to those two services
Unmount from system is what 'deb u' does, sometimes you'll see some errors
And 'deb k' forcibly kills whatever's left (usually whatever was causing the errors from running the 'deb u' command
Save and back out yet again to the main connectbot screen.
4:3:3-3. Connectbot “Local” SSH setup
Make a new connection, this time select ssh, if its not already selected by default and title it something like '[email protected]' just change the debian part to the name of the user you want to login as, such as root perhaps.
1. If you've left ssh running then skip to step 4:3:3-2. If you haven't started it then start it by
Selecting your 'linuxBoot' let it do its thing for a sec or hit 'enter' on your keyboard and let it do its thing for a second.
2. Once you've got ssh server up you can connect to it one of two ways that I know of.
First to test and daily for quick command line access: click on the ssh connection that was made in step 4:3:3-3 of this mini-guide and type the password for that user... and your in.
Second way is to connect with a different device: see section 7:1:2-2
Once you're in you may interact with it like a terminal window and most linux commands will work here with little to no modification. So utilize linux specific sources of information as I'd exhaust myself enumerating and cataloging all the things you can do.
4:3:3-4. Other good combos to use after using 'linuxBoot’
these are connections that I set up with connectbot to quickly run other repetitive tasks that I've saved and used as their own separate local connections. These can also be copy/paste into the command line usually too.
upgrade, update, start a search for something new to install
apt-get upgrade; apt-get update
apt-cache search
Clean out temp and cached files, remove unnecessary junk
apt-get clean; apt-get autoremove; apt-get update
Displays the manual for displaying manuals and the "| less" should make it display a bit frienlyer.
man man | less
4:3:4 Remote RDP debian kit Guide
1. Open Remote RDP, Press menu, Tap add and input the following modifications to the options:
Host=localhost
User=[your-user-name]
Password=[please-don't] can be a security risk
Color=24-bit
Screen=800X600 (though try others based on the physical size of your device)
Compress=checked On
Name=[[email protected]] (think you can name it whatever you like)
2. Back out to main Remote RDP screen and tap on the new connection you've set up.
3. There you will be greeted by either an error prompt (in which case check your settings in step one of this mini guide or run the boot commands described in step 4:3:3-6, specifically deb x) or you will see part of a desktop, window, and or mouse cursor. At this point; verify the username is correct, input your password for that user name, and hit enter.
Note if when you tap or drag on the screen and the mouse cursor follows your finger and not the gesture:
Back out to the main screen on Remote RDP
Press menu, tap settings; or tap the gear icon
Scroll down to Touchpad mode and either enable or disable
Familiarize yourself with some of the other settings while you're here as there are many user interface tweaks you can use.
4. Once you've successfully made a connection, chill for a sec. You're going to at first see a grayish screen, maybe a window bar at the bottom, and then (depending on the speed and available memory of your device) all the sudden it'll paint in a desktop for you to poke around in.
5. On the desktop that Remote RDP has wonderfully supplied; let's get rid of one pesky thing, the screen saver, its a resource and battery drain.
Mouse over to the lower left corner of the screen
There you will see a little 'symbol' click it and in a second it'll pop up a dialog.
Mouse over to options, then screen saver settings, and tap it
In the upper right quadrant of the new window you'll find a drop down menu with disable screensaver being one of them.
Select your choice, then exit out.
Note if logged in as root in Remote RDP you'll receive an error pop up window. In which case instead of mousing over to screensaver settings; mouse over to disable x screensaver under the other directory of the 'start bar' menu and click it. That should resolve having the screen saver coming on in the background while the screen is off and in no need of saving. Other methods welcome.
4:4 Rom Tool Box user Tips
If you've got it then you know its the best; if not, then try the free version and see if it will meet your needs before making the plunge to pro version.
4:4:1 Scripts
Here I will document scripts that I use or am working on.
Boot script
#!/system/bin/sh
: '
starts the remote desktop protocol server and openssh server services and exits the bash automaticly
written for personal use by strangerthanbland 05182013 Use at own risk.
see guide for details on why this script is useful
____________________
https://docs.google.com/document/d/17rboS2kaTNtcd7O7PCSIrlXVud79MHkqUTYohYNIbNI/edit?usp=drive_web
____________________
Comments and suggestions can be directed to either of the above links
_set this to run at boot with rom tool box by copy/pasting in a new script file and tapping on it and selecting Run At Boot Option
_add a new script to rom tool box by opening the app on your device
__scrol down to scripter under the tools tab and tap it
___tap on add then create
____title it what you want and copy past this example from hash sine to the exit command
'
export PATH=/data/local/deb:$PATH
deb x; deb s
exit
ShutDown Script
#!/system/bin/sh
: '
Listens for the device's shutdown command and executes this as one of the shutdown processes
'
4:4:2 Perfomence Mods
The mods explained here are as always a "use at your own risk" sort of affair. What will be contained here? Governors, overclocking and undervolting, memory management, ad blocking, and many more when time permits.
4:4:3 General guide lines
The things that I suggest for ROM Tool Box are only from a user's perspective and are here for easy reference, documentation purposes, and to offer a different perspective. The guide lines for using the material found in sections 4:4:1 - 4:4:4 may be modified but are as follows:
Don't be foolish; this app can be dangerous
Understand your device(s) and my device(s) are different
Comments/problems about the app itself likely should be directed to the developer of that app
Comment/problems about the content here should be directed here to this document or one of it's mirrors
4:4:4 Useful tips
5. Debugging\Known issues with solutions
Contents
5. Debugging\Known issues with solutions​
5:1 debian install problems
So the first part of unpacking debian kit didn't work?
Answer(s):
Troubleshoot it;
check that you're connected to a stable source of internet
check that the file path is correct and that there's no typos
check that the file downloaded is the correct file, redownload after deleting if not
5:2 debian manual install issues
So the second part where I'm making the loop image failed somewhere and things don't work right or left, do I toss my phone in disgust?
Answer(s):
I've had this happen multiple times, kinda sucks when it's nearing the finish line, but to solve this
run the mk-debian -h command for manual install, edit the options until satisfied just like normal, except, you'll be presented with an option to format the existing, abort, and create new.
Choose your destiny like hitting e (format existing) and trying again with the install process.
Aside from that the other solution that I had to resort to was
reflashing my phones rom, kernel, gapps, and reinstalling only the apps required to perform the installation process.
This worked the best as it freed up most of the phones memory and kept the amount of background running tasks to a minimum. Fear not though as after installing linux and testing that it works I was then able to restore and redownload all the apps I had previously, it just meant that I had to re-unpack, re-install; so step one reset is what it turned out to become.
You may also try to create new with that command. I’ve yet to try this but I expect that running the mk-debian -h and changing the name of debian.img to a slightly different name than the one already on your storage device might allow you to test multiple distributions from the root of your sd card without having to uninstall the previously installed one. This is untested but may be useful for saving time and testing all of them by only sitting though the install process for each once instead of the uninstall, reinstall, and repeat fashion that I’ve had to use so far, think of it like installing multiple OS’s to different hard drives in your computer at home. The biggest issue that may be faced is mounting one specifically and keeping the others from mounting if one is already running and mounted, otherwise we’ll run into major slowdowns and errors I’m sure.
5:3 additional packages problems
So I tried to download and install a bunch of things with apt-get and things were going great until a (phone call, text message, random error, or disconnected prompt) shot everything I was plotting down, what do I do to complete the install or download?
Answer(s):
Fret not once linux is installed and behaving itself(mostly) you're atop the shoulders of giants and all that is usually required is
re-running the apt-get command.
There should be a difference in size of archives to be downloaded or installed from the first time that the command was commanded, there may also be errors stating that some of the items are already present in which case we can ignore them(mostly).
If that doesn't work try running the
shutdown example in connectbot after logging out of any other things accessing the linux system, rebooting the device and trying again.
5:4 reinstallation problems
Things worked once then I thought I'd be clever and run the mk-debian command to format and replace the old debian img file because I filled the original and wanted, but I must have told it to do a bad thing because now I get errors like this (dump below). Can I recover or am I screwed?
ln: /system/bin/deb: Cannot allocate memory
Cannot create symlink /system/bin/deb. You need to start with /data/local/deb/deb
Everything looks fine. Type "deb" to start the second installation stage. Refer to /data/local/deb/debian-kit-*.html for further hints.
# /data/local/deb/deb
e2fsck 1.41.11 (14-Mar-2010)
/dev/block/vold/179_2: clean, 7402/432640 files, 92578/1297408 blocks
Segmentation fault
chroot: can't execute '/usr/bin/apt-get': No such file or directory
chroot: can't execute '/usr/bin/apt-key': No such file or directory
cat: write error: Broken pipe
Answer(s):
Screwed. Going to have to try again, double check everything;
Devices kernel compatibility
Stable network connection
Distributions' compatibility
See section 8:2:4 and see if you can resolve it through brute force
maybe try a different distribution of linux. I'm still working on methods to recover without reinstallation, suggestions welcome.
5:5 How do I solve [My device/linux] issue(s)?
The google links provided can be used for quickly starting a search. Input the specifics of your search either by clicking the link and modifying the loaded pages' search bar or copy/paste them into your address bar and placing plus (+) signs between word instead of spaces.
XDA solved search link
http://www.google.com/search?q=xda+solved
XDA similar sites solved link (input modifications after solved)
http://www.google.com/search?q=solved+similar%3Aforum.xda-developers.com&gs_l=heirloom-serp.3...1200805.1281654.0.1282487.42.31.3.3.0.1.1328.6558.0j1j7j7j2j7-1.18.0...0.0...1ac.1.SIKFsmnC-bE&oq=solved+similar%3Aforum.xda-developers.com
Linux solved search link
http://www.google.com/search?q=solved+linux
5:6 How to do a dump like the author
You’ve put up a lot of text from the phone running linux, but whenever I try to select a bunch of connectbot it takes way too much time and never gets everything on the screen, especially the text that is off the screen, how do I make a dump like the author so I can get help with debugging?
Answer(s):
I don’t dump with Connectbot; it just doesn’t work for that one task, instead I use ROM toolbox pro because I already purchased it for other tasks (best money I ever spent on an app) if you too have ROM tool box then follow the following directions for making dumps like mine.
open ROM toolbox pro and make sure you're under the ‘tools tab’ (far left hand side)
scroll down to ‘Terminal Emulator’ and tap it
input your “deb” command not “deb s or deb x” just “deb”
This should log you right into root after a second
log in as a user with sudo or skip to next step in this sequence
input the command that you want to investigate and let it run or produce error messages however it’s been doing so far
once the command is finished with outputting results; press and hold on your devices: screen
tap copy all
open a document creator like google drive and paste it in.
Note: if you run lots of commands in sequence and try to copy/paste over 15000 characters into a google doc it might force close out on you as that will tax most devices’ abilities.
Go through your log of everything that you pasted. For personal debugging I use color formatting and font sizing to show things that I can ignore, delete from the dump, highlight errors, that sort of thing.
Note: Once you've begun the last step its a good idea to be looking up solutions at the same time as at some point you'll be interrupted and seeing where the formatting modifications suddenly stop is a good bookmark for where to pick up again.
Take notes for personal use and compile solutions or methods to not encounter the issues again, past it into an educational forum with a "solved" or "mini guide" apart of its title so it can be quickly found and deployed freely.
5:7 Can I use this to completely replace my Android OS
All that I've read about this would lead me to say "no" . However, the device that you are working on is yours and you can try. Some things to consider though:
Debian Kit is dependent on Android for hardware compatibility
If you mess with your devices' internal partition tables and fail somewhere, then likely the device will be bricked
If you do succeed, then the device that you now have would lose many of its capabilities
Worst case scenario is perma-bricked
Best worst case scenario is semi-bricked or boot-looped
Mainly if you're after a native linux experience without Android fluff you'll likely want to seek out projects similar such as "ubuntu touch" or making your own custom kernel and rom that has the bare necessities for compatibility for your devices' hardware. This last option is an extencive project to undertake, but, thankfully many other people have posted guides along those lines.
5:8 How do I add repositories to Debian?
So I want to add repositories to Debian but I get error messages or I don’t want to manually edit the sources file; how do I do that? Answer; this requires that we first install ‘mr’ because squeeze unlike Ubuntu doesn’t come stock with an easy way to mess with repositories.
First open a command terminal or ssh connection with connectbot under your normal username
enter the following command to install
# sudo apt-get install mr
input your sudo password and accept that it will take about 3404kB on your system
once the install has completed run the following command to pull up the help page. Press ‘q’ on your keyboard at any time to exit the help.
# mr help
Now we can add or edit repositories with the following command.
# mr config
5:9 I get java vertual machine errors when trying to open jar files after following 7:4-4.2 Installing Java for ARM from source.
So I followed the directions to the letter now when I run a 'java -jar [path to jar file] I get the following errors
Examples:
Links:
Answers:​
5:10 Sooooo what's the difference between the arm(hf) and arm(el) that's all over development sites and projects?
Examples:
Links:
Answers:​
6 Introduction, Disclaimer, note to forum Moderator
Contents
6 Introduction, Disclaimer, note to forum Moderator​6:1 Introduction
Yep I put this near the end, mostly so we don't have to look at this every time that we load the page.
There be a guide within the Debian Kit and some of this is very similar, however, typos and customization directions left me wanting a little more. So this all in one start to finish compilation and distillation of information is my contribution after months of google searching reading and hitting errors.
This is a guide for all devices capable of downloading Debian Kit from the android marketplace and for those users of android and linux hybrid systems that need a little help from time to time.
All credit for actual projects referred in this tutorial should of course go to the respective development teams and individuals, this guide is here to serve as a one stop shop of hints, links, and direction for starting your own dualboot mobile system of fantasticness . Some of the combinations of ideas and methods i would consider mine in the sense that i would consider a best seller cookie recipe that I cooked up to be mine, that being stated, I welcome you to use, test, and co-develop with me.
Feel free to question and or assist with this project as i’m no expert.
The Google Document that this is posted from is constantly being updated and should be used to keep the most current with this project. I will be doing updates to the XDA postings of this guide as often as I am able.
6:2 Disclaimer
I will accept no blame for what you of your free will choose to will yourself to choose to do... that being stated what follows assumes that root if not already achieved will be achieved before proceeding to download any of the suggested apps/packages/programs, furthermore you'll need a external source of of storage to install the Linux OS (like a sdCard), yet another prerequisite is considerable patience and time.
6:3 Note to forum Moderator
To the XDA Mod reading this: if posted in wrong section, please notify author and move as necessary; if incomplete and missing references, please notify author and be a little patient as this is still in construction and will continue to be updated until I feel its complete. Thank you and hello.
6:4 Statement of long term goal for this project
To the reader that is unsure as to what the author of this document is suggesting that we do with this (upon completion) full guide. Personal, private, mobile, cloud server is the tree of descriptors that most succinctly names the end goal. Starting from base rooted android system we'll install linux on to three or more "computers" from there we'll install cloud services; one will be the master or host or server, and the remaining two "computers" will have linux with cloud services and be designated as pupets or node. After that its a matter of networking the host and nodes to securely pass data and processes between one another so that when a process is run within the networked cloud system the result is a distributed workload across all the devices. Once that's up and running and debugged we'll install a GUI on top of the cloud system and run some desktop games using one device as a screen and as many other devices as user controls and process load distributors. In short turning recycled android phones into a supercomputer capable of doing super things; gaming just being the example task that I'll likely use to tax the all the devices as much as possible, bend it till it breaks kinda thing. From there its about looking for new ways to leverage such system to perform novel tasks because the android os is still there as well as all the hardware that can still perform tasks, such as your mic, camera, speakers, wireless antennas; I'll be looking into utilize as many inputs as possible, perhaps a mobile Watson that can see, hear, sense location velocity and orientation of each separate device... yep that's the challenge. The “cookie recipe” that I spoke of earlier is rooted and tangled in this concept; running cloud services on the arm processor has already been done, running cloud services on linux has been done, running linux has been done, gluing it all together while still having a cellphone or tablet to play on or text message with (to my knowledge) has not been done... yet...
6:5 Distillation of current project completion
Currently the guide can be followed as a companion to the readme that comes with debian kit, you can get up to the point that I am now. That means for every rooted android device you own you can have linux running operations along side by side, it's like having a pocket computer in every way... almost. From there you can use the apt-get commands much like we use the. Google play store market place (or whatever they renamed it to) to download and install programs (games, network pen testing software, image/video/audio converting and authoring software to suggest a few) or you can use it as a development platform for making games or applications for your phone on your phone, sky should be the limit, at least that's what I'm here to test
7. Getting comfortable and customizing your new system (Part 1)
Contents
7. Getting comfortable and customizing your new system​This section is dedicated to making your life easier if you're new to running Linux on Android. Many of these following guides will function no matter what method you use to run Linux on your device; for example I'll be testing ‘Limbo QEMU’ and ‘Linux on Android’ from the android marketplace, which use outright emulation or chroot “under the hood” so to speak to serve up a Linux environment, essentially giving you the same experience as ‘Debian Kit’... However, there will be some key differences in how the device’s hardware is accessed and I’ll have to split out the eccentricities in those methods so the main goal of the entire document can be achieved.
7:1 Connection Methods
Here will be a culmination of all the ways to connect to your linux system from another device or computer or make more than one linux device communicate with one or more devices.
7:1:1 Connecting locally
7:1:2 Connecting wirelessly through wifi
7:1:2-1: find your android's IP address
At some point you'll need the IP address for your device. To get this information back out to your devices' home screen:
Press menu and tap settings
Tap 'Wireless & networks'
Tap 'Wi-Fi'
Press menu and tap 'Advanced'
There you should find your device's IP address and have the option to 'Use static IP' if you know how to use such things. For now make note of your device's IP address and continue on with some of the ways to use this set of numbers.
7:1:2-2.1 Remote RDP in from a second android device
To do this you'll want to have; already started linux on the Host machine with a 'deb x' command though Connectbot, connected to a wifi access point, and know your IP address.
Open Remote RDP on the device that is not running Linux
Make a new connection by either tapping the plus (+) sign in the lower right of the screen or by pressing menu and tapping ‘add’
Type in the IP address of the device that is running linux into the 'Host' line at the top.
You may press back and then tap on your new connection to test it.
Note: you can always modify the other fields such as 'User' and 'Name' at a later time by disconnecting and then pressing and holding on the connection in Remote RDP main screen and tapping edit
Input your credentials (sometimes you have to do it twice, don't know why) and be amazed that the interface is actually a little peppier.
Now that you have remote access to the device you can now leave it on a charger somewhere and connect into it from rooms away; even if someone else is using it for browsing, and some gaming... I have yet to try it while receiving a phone call though so you may have to reconnect after the call disconnects and that could loose you a session of whatever you were doing, other's comments encouraged.
7:1:2-2.2 Remote RDP in from a second computer
Internal update: tested wile access point received call. Result, internet access dropped, connection between other device and computer stayed alive.
To perform these steps you’ll want a computer running a Remote Desktop Client. I’m using a laptop running Ubuntu 12.04 and I’m connected to the same wifi network as the device (myTouch 3gs) that I wish to connect to. The Android device and computer are connected to the same wifi access point. The program that I’m using on my laptop is ‘Remmia’ which came stock installed with my operating system. To call up the help documentation:
1. Open a terminal window on your computer
2. input the following command
# remmina --help
3. This will either result in your system saying that you don’t have that package installed and maybe a message too stating that it can be installed through an ‘apt-get’ command OR you’ll receive a helpful message.
if you get errors; then search on google for an equivalent application that comes on your operating system and see if you can’t use that instead of installing yet another thing to your computer.
if you get a helpful message; then continue to the next step of this mini-guide.
4. type the following command in your computer’s terminal window to open a new window for creating a new connection.
# remmina --new
5. There will be a bunch of options but right now we’re concerned with the ‘Server’ line. Input your device’s IP address (see section 7:1:2-1 if you need help finding that)
6. Under ‘Resolution’ choose ‘Custom’ and pick something reasonable or leave it at ‘640x480’
7. Mouse down to the ‘Color depth’ option and choose ‘High color (16 bpp)’
8. Click ‘Connect to test without saving or click ‘Save’ to save it for later
9. Once you click connect a new window should appear, and, if you’ve already used ‘Remote RDP’ on the android side of things you’ll likely know exactly what to do here... if not follow the next steps
10. Input your username and password and simit. You may receive the usual error message stating that it couldn’t connect; just try it a second time, input your username and password and try logging in.
11. Once logged in; jump to any other part of this guide and enjoy your linux box on a bigger screen.
12. To re-open and re-connect to the device after shutting down or being disconnected, run the following command to open ubuntu’s RDP
# remmina
7:1:3 Connecting wirelessly through bluetooth
Using the ‘apt-cache search’ command and adding bluetooth seems to return results for obtaining drivers and I’ll be updating this section with source file install instructions when I get around to it. I worn you things of of this nature have the potential for abuse just like wireshark in end result, however, the other much more pressing matter is transmitting data such as audio to another device based on location data from the GPS so we can make a surround sound system that automatically transmits and plays the correct audio from the correct direction to the point selected as center or main listener compensating for the speed at which sound travels at your specific altitude. (this is another cookie recipe I’ll be cooking up)
7:1:4 Connecting wirelessly through data network
7:1:5 Connecting wirelessly through atana directly
7:1:6 Connecting through USB with computer
7:1:7 Connecting through USB with USB host mode
7:1:8 Connecting through visible light spectrum
http://www.ted.com/talks/harald_haas_wireless_data_from_every_light_bulb.html
http://www.ted.com/speakers/harald_haas.html
Saw a presintation on ted.com that leads me to believe the software to make the screen of one phone talk to the front facing camera on another phone and back again may already be availible for linux somewhere. Found some links so the interested can dream with me.
7:1:9 Connecting though invisible light spectrum
This is nothing fancy just another name for 'beaming' files though inferred. It might require that I take apart some remote controls for old tvs and usb charging cable, but it be sweet to have a universal tv remote pug for android.
7:1:10 Connecting though directed/focused light
Yep we're talking about linux android hybrids with frickin lasers shooting out of them.
7:1:11 Connecting through audible sound
Were talking modum squeal and phone line compatibility as there are already good directions for a USB phone line adapter and USB host mode for many android devices, so why not.
7:1:12 Connecting though inaudible sound
Think really high frequencies for device to device communication of live location short range radar like setup.
Think really low frequencies for communicating through solid objects such as tables.
Think multi touch table when you set your phone down. Seen some development.
Think keylogger from across a conference table; project already exists.
7:2 Customization of GUI
Order and numbering of this subsection is subject to change, thus any comments should also reference it's subsection title. Here we'll have a compilation of ways to make your mobile viewing and interaction a more pleasant experience. These commands and directions will either be run on a terminal window or on the linux desktop within Remote RDP.
7:2:1 Saving Electrons
1. Turn off the screen saver.
Mouse over to the lower left corner of the screen
There you will see a little 'symbol' click it and in a second it'll pop up a dialog.
Mouse over to options, then screen saver settings, and tap it
In the upper right quadrant of the new window you'll find a drop down menu with disable screensaver being one of them.
Select your choice, then exit out. (See note and source above 4:3:4-5)
2. Turn off the CPU monitor
Open Remote RDP and login as your user with your password
Once the GUI has loaded send the right click command to the window bar and select 'Add / Remove Panel Items'
Select 'CPU Usage Monitor'
Click on remove
Close the window
3. Set auto lock
Mouse over to the lower left corner of the screen
There you will see a little 'symbol' click it and in a second it'll pop up a dialog.
Mouse over to options, then screen saver settings, and tap it
In the 'Display Modes' tab select the check box 'Lock Screen After'
Set the time to the desired amount of inactivity in minutes
Close the window and wait that long to test it.
4. Set auto shutdown?
7:2:2 Making it Pretty
1. Change your background
Open Remote RDP and login as your user with your password
Once the GUI has loaded send the right click command to the virtual desktop by either
Double tap+hold for a second or two, then release OR
Pressing menu on your device
Tapping ‘Mouse’
A circle will appear that you may tap and drag to control the mouse
4 options will briefly pop up when you lift your finger away from that circle
3 option from the left will send a right click command to the mouse, use it AND
Mouse down to ‘Desktop Preferences’ and tap it
A new window will appear after a moment
Within the new window under the Appearance tab you’ll find your ‘Wallpaper’ settings and an option to set it.
when you choose the option to change your wallpaper a new window/file browser will open. And there you may set a new one and discover where to put pictures from your android side so that they may be quickly accessed for wallpapering your desktop.
2. Change your theme
3. Change the location of your Task Bar
4. Task Bar customization
Open Remote RDP and login as your user with your password
Once the GUI has loaded send the right click command to the window bar and select 'Add / Remove Panel Items'
From here we can do a great many things to customize your experience but for now I'll step ya through duplicating my setup.
Mouseover to 'Add'
In the new pop up dialog choose 'Application Launch Bar' and click 'Add'
In the main window now select 'Edit' and minimise the Panel Preferences window for now.
In the Application Launch Bar window that popped behind select 'Accessories' and select 'Root Terminal'
Click the 'Add' button
Select 'LXTerminal' and click the 'Add' button
Close out of the Application Launch Bar when you're done adding shortcuts and restore the Panel Preferences window
Click on the 'Up' button until the selected application shortcuts are where they should be
7:3 Making things happen without excessive user input
1. Automount script that prompts then runs linux mount after device boot?
2. Disabling the prompt for the automount script.
7:4 Methods of installing or unpacking (Part 2)
_______Split
7:4 Methods of installing or unpacking
1. Moving files between android and linux when their dual-booted.
2. Un-zipping packages and the .rar's that sometimes get in the mix.
3. Installing or running .sh formated installers or scripts.
7:4-4. Installing from sources.
Apt-get is great for installing and uninstalling a plethora of fun and usefull software, however, it’s not going to be the magic bullet for installing everything you may want on your new linux system. What follows are the steps that I take when installing experimental and unsupported software to my devices. As always be careful when copying what I suggest here as your system may have differences to mine.
7:4-4.1 Unpacking tar.gz files
At some point you'll run into the need to extract or unpack something that you can't normally install. For this example I'll show you how to unpack java from sun built to run on ARM linux; you may find it at the link bellow and then download and copy to a new folder in your home directory named 'SourceFiles' or something that you'll remember.
http://www.oracle.com/technetwork/java/embedded/downloads/javase/index.html
1. Run the following commands to back out with change directory to the root comand line, then the next to extract the file
# cd /home/[username]/SourceFiles
# sudo tar -xzvf /home/[username]/SourceFiles/ejre-*
2. Input your password and let it sit for a bit
3. Next we'll move to the next section; installing Java for ARM
7:4-4.2 Installing Java for ARM from source
1. First to make sure my system is cleaned or purged of openjdk I ran the following command.
# sudo apt-get purge openjdk*
2. Make a new folder in the "usr/lib" called "jvm" by first "cd" over to it in the command window
# cd /usr/lib
3. Then make the directory or file with:
# sudo mkdir /jvm
4. Then we move the extracted source files over to jvm folder found under the [root directory of your device]/usr/lib/
# sudo cp -rv /home/[username]/SourceFiles/ejrel1.7.0_21/ /usr/lib/jvm/
Note: if you get "cp: cannot stat..." errors; then run
# cd ~
To get back to the root of your bash screen and try again.
Note: the letter 'v' in both the "cp -rv /home*" and the "tar -xzvf /home*" commands can be removed to keep the amount of text whizzing by to a minimum.
5. Then we create a system link in “sbin/java” that points back to where java is located (think of it like a shortcut that your system can use to run Java commands without asking you where it’s installed) with the following command
# sudo ln -fs /usr/lib/jvm/lib/java /sbin/java
Note: in the above command; the "-fs" part = 'f' forces the link, this makes it so that you can re-run this command if it messes up the first time and the 's' part = create a symbolic link, this is like a short cut... sort of, there are different kinds and you can find more by using
# ln --help
in a terminal window.
Note: the "/usr/lib/jvm/lib/java" part of the command = the full path to wherever the java executable really is and the "/sbin/java" part = where your system normally puts links in. These parts may need changing in odd cases, but, if you've followed along so far without issue then it should be 'safe' to continue.
6. Finally we check that the system can now find java with the following command
# java -version
7. Lone behold you'll likely get an error message stating how "java" isn't a bash command. All is not lost though; we just need to take this to the next guide... 4:2-4.3 Adding Commands to Bash... I know this because you can check your java version by running
# /usr/lib/jvm/lib/java -version
7:4-4.3 Adding Commands to Bash
There be two ways to go about this; one is temporary and uses the alias command in a terminal window, it lasts until your connection ends; the other is getting into your linux bash command file and adding the commands, this will last until you overwrite it again or restore it from a backup of the original or reinstall the entire linux distro, this carries small risk of breaking your install but it seems worth the trouble...
1. Open Remote RDP and log in as a normal user
2. Open the file browser (navigate to the home directory for your user if you're not already there)
3. Mouseover to 'view' at the top of the window (its between 'bookmarks' and 'tools') and select 'show hidden files'
4. Make a new folder for backups of linux system files and a new folder in that explaining where to put the back up. For example mine looks like this: /home/[username]/BackItUP/found_in_home.[username]/[file-that-i-backed-up]
5. Find the file called ".bashrc"
6. Copy the file to the backups folder
7. Open the file ".bashrc" under the original file path eg: "/home/[username]/" with leafpad
8. Ensure the part about aliases has the 'if' statement not commented out. Meaning that if you scroll all the way down in leafpad there should be no '#' before the 'if [ -f ~bash_aliasas*' where you to find one remove it and save the changes
9. Make a new file in your home directory titled '.bash_aliases' by sending the right click command to a blank spot in your home directory and selecting new and selecting create new blank file
Note. If you don't still have hidden files set as visible then the new file will not show up until you do.
10. Open the new file with leafpad and add aliases using the following format
# alias<desired alias>='<linux_command>'
So for this case we'll use this following command to make an alias for java so it can finely run free.
alias java='/usr/lib/jvm/lib/java'
Note: the single quotes around the file path need to be there.
11. Save and test.
Note: you may have to restart your connection ie: log out and back in for the changes to take effect. Totaly worked for me though
Note install prossess not yet compleat; running '.jar' files still return errors. Now trying some new commands:
To let the system know there's a new program to play with we'll use the following command
# sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/lib/java" 1
And to make it the default runtime for java commands we'll use the next command
# sudo update-alternatives --set java /usr/lib/jvm/lib/java
Navigate to the /ect folder on the root of your device and open the enviroment file with LeafPad; add the following lines and save it (of course make a back up befor aplying changes) log out and log back in for changes to take effect
JAVA_HOME="/usr/lib/jvm"
Edit your bashrc file with:
nano ~/.bashrc
And add the following two lines to the tail end and sava and exit:
export JAVA_HOME="/usr/lib/jvm"
export PATH=$PATH:$JAVA_HOME/bin
7:4:4.1- Installing Map Tools
Map tools is Java dependent, meaning that the first steps will involve searching and installing a Java runtime environment with the steps in 7:4-4.1. Then we'll download a map tools zip, unpack it and run the '.jar' file NOT the .sh or .exe as the former is broken and the latter is for windows.
1. Navigate your android browser or iceweasel over to the following link and download ‘maptool-1.3.b89.zip’
http://www.rptools.net/?page=downloads#MapTool
2. Once the download has finished open up a file browser on either OS and copy/past the .zip file over to the following example file path
/home/[your-username]/download
3. Now to unpack/unzip the file...
if this is the first time that your linux distribution you’ll be prompted to select an application to open .zip files with.
in which case you can select the triangle next to ‘other’
scroll down to ‘xarchiver’ and select it and move to step 4 of this mini guide
... or
if this is not the first time that you’ve unzipped something with your linux distribution
just send the ‘right click’ command to the ‘.zip’ file
select extract and move to step 4 of this mini guide
4. Select where you want to extract maptools.zip by ‘clicking’ on the folder icon and in the new window that pops up navigate to the location that you want to extract to.
5. Once maptools has been extracted its time to open a terminal, either though connectbot ssh or by clicking on the programs menu button, mousing up to accessories and clicking on either terminal window option.
6.
7:4:4:2 Solved: Installing jMonkey on Android
1. Download jMonkey from their website. For Linux you’ll want the one ending in ‘*.sh’ and then transfer it to the linux os partition or file structure so you have full read/write permissions over it from the linux side of things
http://jmonkeyengine.org/downloads/?did=2
2. Open a file browser in your prefered RDP GUI application and navigate to the ‘jME3_SDK_3.ORC2-linux.sh’ file; for me I put it in ‘/home/[user-name]/Downloads
3. Right click the ‘*.sh’ file and click ‘Properties’
4. In the ‘File Properties’ window that pops up, after a sec, click on the ‘Permissions’ tab and mouse over to the box that has the words ‘Make the file executable’ and click the box so that it shows a “check mark” instead of a “minus sign or dash”
5. Click the ‘Ok’ button on the ‘File Properties’ window and open a new terminal window (it’s best not to use connectbot ssh or a terminal emulator for running this command as it will need a GUI in a second to load in) and put in the following commands, adjusting the file path to yours would be a good idea.
# sh /home/[user-name]/Downloads/jME3_SDK_3.ORC2-linux.sh
or
# sudo sh /home/[user-name]/Downloads/jME3_SDK_3.ORC2-linux.sh
it’s going to hang out and do nothing for a minute right around line ‘Configuring the installer...’ and again at line ‘Extracting installation data...’ but will eventually start a GUI installation window with a red loading bar and stuff or it’ll throw-up a message like...
...(authers reminder to self ?/home/[UN]/Downloads/jmonkeyUserDump)...
If so then:
6. Assuming all is well and slowly moving you’ll be presented with the jMonkey installation wizard and you can run through the process of selecting where java runtime files can be found and where to extract the jMonkey collection of development tools. It's going to take a minute or sixty but, if you sit back and let it do it’s thing without much else going on on the device, jMonkey will eventually install successfully.
7. It’s not over just yet, once jMonkey is unpacked, installed, knows where “openjdk” or “Java JDK” is (I successfully tested this with openjdk-jdk and it’s family of openjdk packages installed on the device; using an ‘apt-get install’ command’ before running the jMonkey installer) and opens for the first time; you need to mouse over to ‘help’ at the top of the jMonkey window and mouse over to ‘check for updates’ and click it. This step is the one that everyone forgets in their excitement and one of the top reasons for people to search for error fixes right after installing jMonkey. The author on the main page of jMonkey’s install help guide states these steps but there be a lot of words there and it’s right near the top of the text block so I and many others have missed it.
8. After updating jMonkey though the help drop down menu you are ready to rock and roll. Try mousing over to ‘File’ click it and mouse down to ‘new project’ click it and click ‘Next’ and ‘Finish’ to keep default settings, wait a second or two, and start making stuff that can then be exported out to formats that are compatible on just about any device and any os you may want to write a game for.
9. For help with this specific program “jMonkey” you should direct your attention to:
http://jmonkeyengine.org/forum/
and
http://en.wikipedia.org/wiki/JMonkey_Engine
and for help with getting jMonkey to run on android with linux dual booted; then direct your attention here on this document and it’s mirrors.
You can comment on the program itself here too but, as I’m not the developer of the program, my knowledge of what make’s it work and not work is very trial and error at times. My primary concern is making it easy to install on your device so that developers on that site have another method/platform to do developing with.
Next up?... Syncing files between your android, dual booted Linux distro, And your home PC.
Why? Because being able to sync between all your devices seamlessly will allow quicker development for these systems on the whole.
8:2:4 Example of the first time you run deb command
8:2:4 Example of the first time you run deb command (see sections 5:4 , 1:3:2-7)
# /data/local/deb/deb
e2fsck 1.41.11 (14-Mar-2010)
b: clean, 5498/432640 files, 99548/1297408 blocks
armel
I: Installing core packages...
I: Unpacking required packages...
I: Unpacking libacl1...
I: Unpacking libattr1...
I: Unpacking base-files...
I: Unpacking base-passwd...
I: Unpacking bash...
I: Unpacking libbz2-1.0...
I: Unpacking coreutils...
I: Unpacking dash...
I: Unpacking libdb4.8...
I: Unpacking debconf-i18n...
I: Unpacking debconf...
I: Unpacking debianutils...
I: Unpacking diffutils...
I: Unpacking dpkg...
I: Unpacking e2fslibs...
I: Unpacking e2fsprogs...
I: Unpacking libcomerr2...
I: Unpacking libss2...
I: Unpacking libc-bin...
I: Unpacking libc6...
I: Unpacking findutils...
I: Unpacking gcc-4.4-base...
I: Unpacking libgcc1...
I: Unpacking libstdc++6...
I: Unpacking grep...
I: Unpacking gzip...
I: Unpacking hostname...
I: Unpacking insserv...
I: Unpacking lsb-base...
I: Unpacking liblocale-gettext-perl...
I: Unpacking libselinux1...
I: Unpacking libsepol1...
I: Unpacking libtext-charwidth-perl...
I: Unpacking libtext-iconv-perl...
I: Unpacking libtext-wrapi18n-perl...
I: Unpacking mawk...
I: Unpacking libncurses5...
I: Unpacking ncurses-base...
I: Unpacking ncurses-bin...
I: Unpacking libpam-modules...
I: Unpacking libpam-runtime...
I: Unpacking libpam0g...
I: Unpacking perl-base...
I: Unpacking sed...
I: Unpacking sensible-utils...
I: Unpacking login...
I: Unpacking passwd...
I: Unpacking libslang2...
I: Unpacking initscripts...
I: Unpacking sysv-rc...
I: Unpacking bsdutils...
I: Unpacking libblkid1...
I: Unpacking libuuid1...
I: Unpacking mount...
I: Unpacking liblzma2...
I: Unpacking sysvinit-utils...
I: Unpacking sysvinit...
I: Unpacking tar...
I: Unpacking tzdata...
I: Unpacking util-linux...
I: Unpacking xz-utils...
I: Unpacking zlib1g...
I: Configuring required packages...
I: Configuring ncurses-base...
I: Configuring sensible-utils...
I: Configuring libc-bin...
I: Configuring gcc-4.4-base...
I: Configuring libc6...
I: Configuring debianutils...
I: Configuring bsdutils...
I: Configuring libsepol1...
I: Configuring libgcc1...
I: Configuring libncurses5...
I: Configuring libattr1...
I: Configuring e2fslibs...
I: Configuring base-passwd...
I: Configuring libcomerr2...
I: Configuring mawk...
I: Configuring libdb4.8...
I: Configuring hostname...
I: Configuring libacl1...
I: Configuring libslang2...
I: Configuring libss2...
I: Configuring liblzma2...
I: Configuring insserv...
I: Configuring gzip...
I: Configuring libbz2-1.0...
I: Configuring libselinux1...
I: Configuring libstdc++6...
I: Configuring coreutils...
I: Configuring ncurses-bin...
I: Configuring diffutils...
I: Configuring tar...
I: Configuring zlib1g...
I: Configuring base-files...
I: Configuring xz-utils...
I: Configuring dpkg...
I: Configuring sysvinit-utils...
I: Configuring dash...
I: Configuring perl-base...
I: Configuring libtext-iconv-perl...
I: Configuring sed...
I: Configuring grep...
I: Configuring findutils...
I: Configuring liblocale-gettext-perl...
I: Configuring bash...
I: Configuring libtext-charwidth-perl...
I: Configuring libtext-wrapi18n-perl...
I: Configuring lsb-base...
I: Configuring debconf-i18n...
I: Configuring debconf...
I: Configuring libpam0g...
I: Configuring sysv-rc...
I: Configuring libpam-modules...
I: Configuring tzdata...
I: Configuring passwd...
I: Configuring libpam-runtime...
I: Configuring initscripts...
I: Configuring login...
I: Configuring libuuid1...
I: Configuring sysvinit...
I: Configuring libblkid1...
I: Configuring util-linux...
I: Configuring mount...
I: Configuring e2fsprogs...
I: Unpacking the base system...
I: Unpacking adduser...
I: Unpacking apt-utils...
I: Unpacking apt...
I: Unpacking aptitude...
I: Unpacking libboost-iostreams1.42.0...
I: Unpacking bsdmainutils...
I: Unpacking cpio...
I: Unpacking cron...
I: Unpacking libcwidget3...
I: Unpacking debian-archive-keyring...
I: Unpacking libgdbm3...
I: Unpacking gnupg...
I: Unpacking gpgv...
I: Unpacking groff-base...
I: Unpacking ifupdown...
I: Unpacking iproute...
I: Unpacking iptables...
I: Unpacking iputils-ping...
I: Unpacking isc-dhcp-client...
I: Unpacking isc-dhcp-common...
I: Unpacking logrotate...
I: Unpacking libept1...
I: Unpacking libnfnetlink0...
I: Unpacking libsigc++-2.0-0c2a...
I: Unpacking libusb-0.1-4...
I: Unpacking man-db...
I: Unpacking manpages...
I: Unpacking module-init-tools...
I: Unpacking nano...
I: Unpacking libncursesw5...
I: Unpacking net-tools...
I: Unpacking netbase...
I: Unpacking netcat-traditional...
I: Unpacking libnewt0.52...
I: Unpacking libssl0.9.8...
I: Unpacking libpopt0...
I: Unpacking procps...
I: Unpacking libreadline6...
I: Unpacking readline-common...
I: Unpacking rsyslog...
I: Unpacking libsqlite3-0...
I: Unpacking info...
I: Unpacking install-info...
I: Unpacking libudev0...
I: Unpacking libxapian22...
I: Unpacking whiptail...
I: Unpacking tasksel-data...
I: Unpacking tasksel...
I: Unpacking traceroute...
I: Unpacking udev...
I: Unpacking vim-common...
I: Unpacking vim-tiny...
I: Unpacking wget...
I: Configuring the base system...
I: Configuring module-init-tools...
I: Configuring libgdbm3...
I: Configuring isc-dhcp-common...
I: Configuring libpopt0...
I: Configuring libusb-0.1-4...
I: Configuring libxapian22...
I: Configuring install-info...
I: Configuring libssl0.9.8...
I: Configuring vim-common...
I: Configuring netbase...
I: Configuring libudev0...
I: Configuring adduser...
I: Configuring traceroute...
I: Configuring manpages...
I: Configuring libsqlite3-0...
I: Configuring iproute...
I: Configuring wget...
I: Configuring groff-base...
I: Configuring libnewt0.52...
I: Configuring net-tools...
I: Configuring bsdmainutils...
I: Configuring libsigc++-2.0-0c2a...
I: Configuring netcat-traditional...
I: Configuring libncursesw5...
I: Configuring info...
I: Configuring iputils-ping...
I: Configuring cron...
I: Configuring nano...
I: Configuring udev...
I: Configuring libboost-iostreams1.42.0...
I: Configuring rsyslog...
I: Configuring cpio...
I: Configuring isc-dhcp-client...
I: Configuring vim-tiny...
I: Configuring readline-common...
I: Configuring libnfnetlink0...
I: Configuring man-db...
I: Configuring procps...
I: Configuring whiptail...
I: Configuring ifupdown...
I: Configuring libreadline6...
I: Configuring logrotate...
I: Configuring libcwidget3...
I: Configuring iptables...
I: Configuring gpgv...
I: Configuring gnupg...
I: Configuring debian-archive-keyring...
I: Configuring apt...
I: Configuring libept1...
I: Configuring apt-utils...
I: Configuring aptitude...
I: Configuring tasksel-data...
I: Configuring tasksel...
I: Base system installed successfully.
OK
Your next steps: enter 'apt-get update' to fetch package lists, and 'apt-get install andromize' to add a small packet that further adapts Debian to the Android environment.
•
Dear Sir,
Good day.
This is Suresh from India. First I thank you verymuch for your wonderful project :good: and I use now. Anyway I thanked you 6 times for this thread, which may make you happy.
I have tested 3 linux images through 'complete linux installer' project and 2 linux images through your 'Debian Kit' project.
I couldn't get root access and access to SD card content through 'Complete linux installer' project, but other things are good.
But in your 'Debian kit' project only, I got root access to linux system and got SD card content access.:good: Thank you.
Actually I installed the Linux images through the guide from this link - http://sven-ola.dyndns.org/repo/debian-kit-en.html.
Is this your's link ? Because,name is different, 'Sven-Ola', thatswhy, I asked.
Ok. first I tried 1GB disk image with Debian Stable version in my SD card. It was good until installing some programs through 'apt-get' command, then I got issue,the connectbot didn't start RDP (through 'deb x' command) and gave 'out of space' error in /var folder, actually I forgot that exact error. Sorry.
Then I installed 2 GB disk image with Ubuntu Lucid version in SD card (fat32 file system,8 GB). It was also well upto installing 2 programs,(Open office and Epiphany browser), because, there is no 'office' preinstalled in package. But , Yesterday, I tried 'docky' (like as Cairo dock) package through Synaptic. It downloaded, but during installing, it hanged at some point. I have attached the screenshots herewith. It hangs for ever. So, I typed exit. After that I tried some commands as 'apt-get autoremove', 'apt-get upgrade' and some commands. But, It give the same error - 'dpkg was interrupted, so you have to reconfigure through 'sudo dpkg --configure -a' for correction. But, after typing that command, again it hangs at some point. After that I couldn't remove the 'docky' package and also I couldn't use synaptic. the synaptic couldn't start through terminal. It gives the same error and hangs.
So, please help.
Issues for me in 2GB, Ubuntu lucid version.
1. There is no Office installed in package. So, I manually installed openoffice through 'apt-get' command (but, it is not a big deal)
2. Firefox crashes at starting, even at single time, it didn't open. (it is not only in 'Debian Kit', also in 'Complete linux installer' for in my Dapeng A9230+, 5 inch mobile, MTK6575, ARM V7 Cpu, 1 Ghz using Custom ICS 4.0.6). So, I removed firefox. Installed chromium-browser, but, chromium also didn't open. Finally installed 'epiphany browser' through 'apt-get' and it works good. (It is also not a big deal for me )
3. Synaptic package manager and Software sources, both didn't open. I have to open through 'Terminal' as 'Sudo synaptic' and for 'software sources' - another command... I forgot that. But, 'sudo synaptic' also gives some error, please see screenshot, But it opens synaptic.
Last Question - For safety, I have copied the downloaded 'Debian.img' from SD card to my PC. If suppose, I want to reinstall in another ROM,, what exactly I have to do ? ..... Yes, you have already mentioned.......
The following is Ok ? from this page - http://sven-ola.dyndns.org/repo/debian-kit-en.html
"To remove the kit from your Android device later on, start a root shell and enter /data/local/deb/uninstall. After this, do not forget to remove the debian.img file from your SD-Card, e.g. by using a file manager app."
Then , this
"If you upgrade/change your Android ROM, typically the debian.img file on the SD card isn't lost. However, you may miss the deb link and also, there may be stray symlinks in your Debian file system pointing back to now non-existing files. Download and unpack the debian-kit*.shar file, run /data/local/deb/mk-debian -u to re-create the deb link and deb c to remove all backpointing symlinks (they will be re-created on the next turn)."
After this, Will it again start to download some packages in New ROM ?
Ok. Again thanks for your hardwork.:good:
Love your guide worked out well for me. I uninstalled and reinstalled like 30 times to memorize the prosses incase somthing happend so I can fix it. I was just wondering if you going to get more distros working using this method. Linux Mint is at the top of my list and of course Fedora, Open Suse, Arch, LMDE, Gentoo, Slax(or Salix), FreeBsd. I know all dont have arm ports yet but I know Fedora does, and Linux mint is a modified version of ubntu. Lastly I realy hate LMDE desktop enviroment is there a method to get other desktop enviroments and remove the one installed at the same time to prevent conflicts. I know I am asking alot I am just throwing ideas out there that Im sure other people who read you guide would be asking.
added bunch new content and formating, interduced new sections and consepts
howdy all; really good to get some responses as I understand this to be on the super-tech side of life. I posted some longstanding solutions above in the RESURVED3 post of this thread to some of the issues that where brought up (their up there and will eventually be edited for easier readability as the organization of the proposed solutions are a bit "mind dumped" as I was reading solutions and my other notes)
Love the screen shots, I've yet to try any applications on android for this task so the guide right now is a bit of a novel and I'd like to bring in more of a picture book like experience for some of the more complex tasks. Suggestions welcome as always.
Excited that you're all enjoying this project. I've been working all day today in order to reorder and bring new updates and I've just finished updating all effected posted changes (at this point every-time I do that it's going to mess with the visibility on the mobile side) all other changes tonight can be found live on the google doc side of things if you use the google drive app in chrome on pc or the google drive app from the market place. There you may also make specific notes by highlighting a sections' title (please only highlight the section title unless otherwise specified for making notes) and beside near the top of your screen you'll have a speech bubble that may also pop up when highlighting words within the document. This speech bubble will allow us all to comment on specific parts and see other's comment's in a nearly live format.:highfive:
pc
https://chrome.google.com/webstore/...fndbhieahigkjlhalf?utm_source=chrome-ntp-icon
Or
android
https://play.google.com/store/apps/...s.docs&feature=nav_result#?t=W251bGwsMSwyLDNd
@alchemygear
the other things I'll be trying out and have tried out to some extent is QEMU for pc and android now, see the links. My epic 4g has no problem running a full GUI with Limbo, the mytouch 3gS though only can handle command line interface so I bailed on it when debian kit crossed my radar and loaded without a problem on a 600 mhz processor. Once I've a good guide that we can all use for installing linux to one system at a time I'll be working on some of my command line knowledge so that I can run android, QEMU, and debian kit all at the same time and all on the same hardware... really going to tax the system but it will allow me to make each one of my devices act as though it has two linux systems, effectively doubling the number of virtual machine nodes that I can debug on, however, doing so causes me to predict enormous slowdowns and possibly overheating of the hardware. But the benefits will be that I'll be able to have one real master and two real puppets or a system with one virtual master and five virtual puppets (this is because I'm currently limited to three devices at my disposal; one epic 4g slide and two mytouch 3g slides) or any combo between. Once I've a stable way of linking and assimilating new hardware whether it be virtual or real I'll be able to really expand this protect and make custom cloud servers for those that want one but don't want to learn the nitty gritty details because the applications that one could use such a system should get the imagination revving.
Didn't want to leave ya hanging without a full response to some of the things that I'm working on and with, hope it helps.
pc
http://wiki.qemu.org/Main_Page
Or
android
Limbo PC Emulator (QEMU x86)
https://play.google.com/store/apps/...vbS5tYXgyaWRlYS5hbmRyb2lkLmxpbWJvLm1haW4iXQ..
@ramsuresh4
I've been busy as of late, sure you'll see some changes all over, posted some options at the top of this page that may resolve some of your questions RESURVED3... think I may have mentioned that before in this post... let me know if there's something that I missed; kinda juggling all aspects of this protect (but I've got some teem mates catching up quickly:highfive at the moment so some answers will take longer for me to be able to test and debug so google and self improving attitude is the best bet aside from keeping up with the changes I make to the "doc" not to put you off or anything, just got to be 100% good and honest to humans :cyclops::silly: I'll be kicking round on the mobile side of things so updates to the "doc" first as always.
Ok all I'm shutting down my laptop as its become a knee-toaster and moving over to one of my device. You can find me on the google document that I'm writing and I'll be checking back from time to time on XDA.
I know the things i proposed will take time but one issue I am having is the small partion it creates. I tried expanding the partion to the whole disk but it just shrinks it down again. As i said I hate LXDE and would like to put a different desktop enviroment but most take up more space than given. How do you expand the partion size I need more space to work with I need 12 gigs. Lastly I really want linux to be the only sytem on my tablet, I hate android, I full linux tablet is my dream so not resorces are waisted on android. Thanks for taking the time to read my post and comment on it, I look foward to see the progress you make and I look forward to testing it.
alchemygear said:
I know the things i proposed will take time but one issue I am having is the small partion it creates. I tried expanding the partion to the whole disk but it just shrinks it down again. As i said I hate LXDE and would like to put a different desktop enviroment but most take up more space than given. How do you expand the partion size I need more space to work with I need 12 gigs. Lastly I really want linux to be the only sytem on my tablet, I hate android, I full linux tablet is my dream so not resorces are waisted on android. Thanks for taking the time to read my post and comment on it, I look foward to see the progress you make and I look forward to testing it.
Click to expand...
Click to collapse
Added updates to "doc"
________________________
Heh, glad to know that we're on the same wave length on expectations.
Partitioning is a tricky bit to the install process; one of the reasons I covered it in a different fashion than the one that can be found in the "debian kit readme" you can find my way in section 1:4 I think.
Remember for partitioning
~leave that tinny space at the beginning alone.
~leave make a partition for android to use the first partition
~make the android partition large enough that you can fit your: backups, re-flashing zips and recovery directions with files for recovering from a soft brick, and android system info that automatically likes to save there... about 3 gigs for me at the slimmest
~make the second partition the size of remaining space after the android partition.
~ensure all partitions are at the correct size and that you didn't accidentally move or over write that beginning few magabites during any of your edits (this is important)
~ensure that all have labels of some sort and drive letters you'll remember and that don't cause conflicts with your currently mounted drives on your computer (had errors when my sdcard remounted after partitioning on my computer because the second partition of the sdcard and the drive letter for my computer's cd read/write drive where the same.)
~hit apply and hope no background task on your computer makes things barf. (Try turning off your computer's internet, or, starting these steps from a fresh reboot, or, in a live cd environment whether it be real or running in VM)
Hope it helps, I'll be working on partitioning again as my myTouch's debian install has gotten chubby again with all my testing. Updates will be where they always are first
As for LXDE I encourage you to experiment. I've seen methods around for installing other GUI's to the "armel" flavor of linux but I've been on other tasks with this guide as of late. I'll be back on it as I'm going to be trying to link one of my phones as a secondary keyboard and the other spare phone I have as a 3D mouse (both are myTouch 3Gs) so that I can use my epic 4g as the main screen. Currently LXDE serves my purposes fine but I like you will want something a bit more snazy... added a sub section in section 7 so I can add info related to this as I've time to do so.
Running Linux as your rom is still in development stages and very risky for your device as it wipes everything off your device and I mean EVERYTHING you'll want to know how to recover from a full brick or super brick on your device though a computer and you'll want to have been though re-partitioning your system memory, re-flash your boot loader, re-flash your stock rom and kernel and programing, and re-rooting. You can find an Ubuntu flavor of Linux that will do just what you are asking, just google search "Ubuntu touch" and read up about it. Last I checked things where going really well for that team and there is already a lot of documentation on it.
Furthermore google search "linux android kernel merging" you'll find exciting news that the linux and android kernels are soon to become one. There is a big push for this from all over the dev communities and news is constantly being updated for it as this is very good, very good indeed for us all.
Hope I can make your heart beat a little faster with excitement for the future of mobile computing and thanks for the feed back I'll be working off and on throughout the day on the "doc"
________
UPDATE
More content on "doc" emailed the developer of Debian Kit
Sent from either my SPH-D700 or myTouch3Gs
Debian Kit Install guide for all
http://forum.xda-developers.com/showthread.php?t=2240397
Or
https://docs.google.com/document/d/1ssVeIhdBuuy8CtpBP1lWgUkG6fR6oHxP20ToYPPw6zI/edit?usp=drive_web
Thanks for the speedy response, first dont worry I have bricked my tablet, hard and deep a few times and figured out the secret to fixing it. I have to use my wifes computer and Pheniox Suit(she has windows and I cant fast boot my tablet as its a chinese tablet that has something like a rockchip which needs speacial softwar) to fix it but all I have to do is power down by holding the power key for 12 seconds, then pugin in too the computer with home pressed and then while home and power for 12(my tablets weird not 10 12 ?) seconds and then clicking the flash firmware button in the software even though its says no device detected it force flashes the rom everytime. My tablet only has 2 keys home and power. I will have to play around with the formating methods as I have tried what you said a few times but cant seem to get it right. I have been useing gparted as it has done well for me in the past few years, if you have a sugestion as to something better or point me to a guide for using the command line(im not affraid of it, it gives so mutch more power and controll). Thanks again for interacting with me and being knowedgeable about what your doing, I can't count how many sites and forums I have been to that have either no resoponses or just bull**** me because they dont really know what there doing and want to seem smart. I know I have years to learn about linux itself mutch less tablets eventhough I have been on linux for about 10 years(anyone who uses linux knows there is no end to what you have to learn).
Welcome, I lurk like a spider on this thread.
Neat I know very few with the combo of working knowledge and desire to abuse it perhaps you might be able to get the last puzzle peace in place for the tablet user in below link's thread, device is Chinese build 9 inch model #A13F9 or just A13, the user having issues has gotten past the dreaded kernel panic screen and has a working android boot, touch drivers is where this user and many others have gotten stuck and at this point it's so device specific that I'm almost out of general knowledge and long term memory stores, check it if you got time don't if you don't.
http://forum.xda-developers.com/showthread.php?t=2233159&page=4
OK back to our regularly scheduled programing:
So if I get you right your device has no external (real external like sdcard slot-less) if that's the case then Debian Kit as an app will not serve your stated goals; instead let's go on a montage of protects that I know of:
Ubuntu touch
http://www.ubuntu.com/phone/ubuntu-for-android
Dig around I found directions once to do a full flash of Ubuntu touch that over wrote everything.. I'll find it eventually or you will as this is exactly what I think you are asking for.
Linaro
http://www.linaro.org/
They are doing something savage. I've said plenty elsewhere.
Complete Linux Installer
https://play.google.com/store/apps/details?id=com.zpwebsites.linuxonandroid
I used this one second I think out of the history of apps I've used to push my processor. Uses a virtual loop disk drive mount like system that tagges along with the android OS. Much like installing to debian.img with Debian Kit as far as needing android in the mix, but, the methods between the apps for mounting a second OS are different. Compare the descriptions of each in the android market place to see what I'm talking about.
Limbo PC Emulator
https://play.google.com/store/apps/details?id=com.max2idea.android.limbo.main
This one is really cool as it allows you to create virtual hard drives in a couple formats, emulate a whole list of pc processors including Pentium 3, install nearly any OS to the virtual hard drive if you've got a working iso, and best of all if you do the install to virtual hard drive (and in some cases convert the pc's vm hard disk to a compatible format for Limbo to read... not actually that hard with google on my side) with a pc using a program like virtual box from oracle; you can then 'run' that virtual hard drive and it's installed OS on on an android system that doesn't have the capability to do the install process (usually this work around is really useful for older and low memory devices) very round about but useful if you want to boot gParted as though it where on a Pentium 3 computer and mess with partitions though USB host mode linked usb hard drive.... ok now to get where this gets dangerous use and no one and I mean it
###NO ONE READING THE FOLLOWING LINES SHOULD ATMEPT, BELIEVE, OR FOLLOW #####
Let's say that you've calculated the size of your ram on your device to be adequate to: run a striped android OS, Limbo, and a striped down linux kernel with just enough wits to run: partitioning, mounting and un-mounting, one to one duplication of files, and full USB support, screen output (those will be tricky but necessary as your willing your device into a brick). Let us also for arguments sake that you've full root and full read write permissions wile in this state to the 'real' android OS... that means you can then re-partition 'locally' all of your real system partitions, mount a secondary storage (can also be an sdcard for other devices; such as if you where to run though all these very knotey steps on an emulated android system identical or similar to yours on a safe virtual machine for debugging on a pc) though usb and either pull from the device side or push from the pc side: all the scripts and hardware drivers and directories to run Linux on your build, verify a complete and full clone has been made and pray to the dieaty of your choose, because when you reboot your device it will either be bricked (possibly for good this time) or it will chug away until the screen starts scrolling text and prompts you for input.
Things you'd want to look in to likely is first building a custom kernel that is stable, play around for a bit with it because it may distract you long enough for android and linux kernels to finely merge, by that point or when you tire of customization to your kernel you'll want to move on to: kernel rebuilds and building custom kernels. When you've all three of those to the point of understanding that you can read most of it and write some of it you should probably divide your attention some and dive into the same subject matter for your Linux distro of your choice, try to pick one that supports active development in kernel rebuilds specifically as what will need to happen is a mirage or hybridization of many disparate machine code language specific hardware resource calls and user interface listeners that maybe difficult to find any documentation on. In any case don't try that as mounting usb wile running android from ram is... incredible
#####NOW SAFE TO READ AGAIN
End montage... for now...
Glad I can meet or exceed expectations. Most of my linux training comes from years of playing with it and lots of google searching, I'll post up a copy of my bookmarks worth having backup eventually for you to pick though and update ya on good guides from time to time. The thing I heard somewhere about linux "good friend don't let their friends linux"
With that, good night and enjoy the falling stars if you look up.
Sent from either my SPH-D700 or myTouch3Gs
Debian Kit Install guide for all
http://forum.xda-developers.com/showthread.php?t=2240397
Or
https://docs.google.com/document/d/1ssVeIhdBuuy8CtpBP1lWgUkG6fR6oHxP20ToYPPw6zI/edit?usp=drive_web
Some nice reading you provided. With linux on arm my major issue is that there is not a lot of support for 4 core proccesors yet or so I have been told. The full flash ubuntu is for duel core prossesors so no luck for me. Thanks again for continuing to update and inform on a not so well know system.
Here is the build of my device http://gfxbench.com/device.jsp?benchmark=gfx27&D=Onda+V812+Core4&testgroup=system. It has all the details.
Dear Mr.SoAndSo and All,
Mr.SoAndSo, you are updating the thread well. Greetings.
I can't solve my 'dpkg interrupted' error in 2GB Ubuntu Lucid Version. So, I uninstalled that and downloaded, installed New 2GB, Ubuntu Precise through 'Debian Kit'. Installed, Libre office, Synaptic, Epiphany browser. But, Epiphany design is not good for me, compared to firefox, Iceweasel. If I try to install, Iceweasel through 'apt-get', It asks to install firefox. But, you know that, firefox, chromium didn't work.
Anyway I enjoy this OS. I have attached the screenshots here.
Thanks.
Sent from my Dapeng A9230+ through XDA mobile.

[LIB] Java ADB Library (AdbLib)

Overview
About a month ago I got the urge to do some reverse engineering of ADB so that I could write an Android app that would be able to talk to devices the same way that the adb command-line tool distributed with the Android SDK does (without requiring root!).
The app that came about from this work has been on the Play Store about a month: https://play.google.com/store/apps/details?id=com.cgutman.androidremotedebugger
I had planned to do an open-source release of the library that I wrote for the app, but hadn't found the time to tidy up the code until recently. So today is my official announcement of the open-source release of my ADB work.
TL;DR full sources and detailed JavaDoc are here: https://github.com/cgutman/AdbLib
Functionality
AdbLib implements a connection object (AdbConnection) that sits atop a standard Java Socket class which it uses as the underlying transport for the ADB connection and all streams operating over it. The AdbConnection object contains methods for the creation of AdbStreams which represent the underlying data streams of ADB. AdbConnection also maintains the connection thread responsible for processing and responding to packets from the target device.
The AdbConnection object has an associated AdbCrypto object which abstracts the 2048-bit RSA key authentication used on Android 4.2.2 and later. AdbCrypto also has the capability of saving and loading key pairs, along with generating a fresh key pair. AdbCrypto requires an implementation the AdbBase64 interface which does the conversion of the RSA public key to a Base-64 encoded string that is transmitted to the 4.2.2+ device the first time it connects.
There's also low level AdbProtocol class which has many useful definitions and functions for receiving, validating, and generating ADB packets. This class's methods and fields are used by AdbConnection for packet processing and generation.
Conclusion
Hopefully you guys can do something cool with this library. It's under the BSD license so there shouldn't be any problem getting it included in any projects. I'd be happy to help with any bugs found or provide assistance integrating the library into projects. I also accept patches/pull requests
I've also published the Wireshark dissector I wrote to analyze the ADB protocol: https://github.com/cgutman/wireshark-adb-dissector
@cgutman thanks for this. I am examining how I can integrate this into CASUAL. It would be good for keeping the ADB process count low.
Would you be kind enough to document the flow here? I'm reading the code and I'm 1/2 way getting it, but I want a solid plan before I do a full-scale integration. Do you think you can do a flow of some sort?
Here's how I would be interested in using this library, from the desktop side. Would I hit any limitations here?
adb detect-device loop on port 5555
adb devices -- get number of devices detected
adb push -- fileinputstream from local file to /sdcard/
adb reboot recovery
adb wait-for-recovery
adb shell "echo foo>/data/cache/bar"
adb shell killall recovery
adb reboot
adb wait-for-device
It would be really neat to be able to contribute some things to this project and if this has basic functionality to be able to perform the above from the desktop side, I would be interested in generating several helper methods/classes which will act more familiar to those who are used to the command-line binary. I would also add features not found in command line like adb wait-for-any.
AdamOutler said:
@cgutman thanks for this. I am examining how I can integrate this into CASUAL. It would be good for keeping the ADB process count low.
Would you be kind enough to document the flow here? I'm reading the code and I'm 1/2 way getting it, but I want a solid plan before I do a full-scale integration. Do you think you can do a flow of some sort?
Here's how I would be interested in using this library, from the desktop side. Would I hit any limitations here?
adb detect-device loop on port 5555
adb devices -- get number of devices detected
adb push -- fileinputstream from local file to /sdcard/
adb reboot recovery
adb wait-for-recovery
adb shell "echo foo>/data/cache/bar"
adb shell killall recovery
adb reboot
adb wait-for-device
It would be really neat to be able to contribute some things to this project and if this has basic functionality to be able to perform the above from the desktop side, I would be interested in generating several helper methods/classes which will act more familiar to those who are used to the command-line binary. I would also add features not found in command line like adb wait-for-any.
Click to expand...
Click to collapse
already sounds like this could become very useful, an option to pull partitions from the device would be nice aswell!
ricky310711 said:
already sounds like this could become very useful, an option to pull partitions from the device would be nice aswell!
Click to expand...
Click to collapse
I've already got that option in CASUAL. Download any CASUAL from last night on, and you can use CASUAL.jar --execute "$PULL /dev/block/whatever, local file". The $FLASH command works the same, but it requires that you invert the args. It establishes a direct connection via TCP over USB and flashes the partition.
Will definayltely check it out, any chance of autodetection in the future?
For example umm
$pull boot
Autodetects mmcbl0p5?
Or is it just something we are gonna have to live with?
Sent from my GT-I9300 using xda app-developers app
ricky310711 said:
Will definayltely check it out, any chance of autodetection in the future?
For example umm
$pull boot
Autodetects mmcbl0p5?
Or is it just something we are gonna have to live with?
Sent from my GT-I9300 using xda app-developers app
Click to expand...
Click to collapse
That would be another feature all together... I can make that happen on newer devices. But this method WILL require root access of some kind on the device. Its really intended for flashing a recovery as part of a root exploit and making a backup of said recovery.
That would be great, I know this can be done on a rooted phone with pushing a utility to xbin or sbin and using shell to copy the boot.img to sdcard then pulling it?
Sent from my GT-I9300 using xda app-developers app
AdamOutler said:
@cgutman thanks for this. I am examining how I can integrate this into CASUAL. It would be good for keeping the ADB process count low.
Would you be kind enough to document the flow here? I'm reading the code and I'm 1/2 way getting it, but I want a solid plan before I do a full-scale integration. Do you think you can do a flow of some sort?
Here's how I would be interested in using this library, from the desktop side. Would I hit any limitations here?
adb detect-device loop on port 5555
adb devices -- get number of devices detected
adb push -- fileinputstream from local file to /sdcard/
adb reboot recovery
adb wait-for-recovery
adb shell "echo foo>/data/cache/bar"
adb shell killall recovery
adb reboot
adb wait-for-device
It would be really neat to be able to contribute some things to this project and if this has basic functionality to be able to perform the above from the desktop side, I would be interested in generating several helper methods/classes which will act more familiar to those who are used to the command-line binary. I would also add features not found in command line like adb wait-for-any.
Click to expand...
Click to collapse
AdbLib is a low-level abstraction of an ADB connection and its associated streams. It might not be exactly what you're looking for here. It's not really meant to be used as a direct replacement for the full adb command line client, since for one, it only handles ADB devices over the network.
There's no concept of detecting devices since connections are driven by you specifying a target to connect to. Conceivable you could push files with AdbLib (since it's just pushing data over a stream) but I haven't analyzed that protocol enough to know how it expects the file data to be sent.
Similarly, some of the special adb commands like "reboot" and "reboot recovery" should theoretically just be streams too, but I haven't analyzed the way the protocol deals with those commands.
The shell commands should be simple to send over AdbLib (since that's what it was originally designed for). To do this, you create a socket connected to your ADB target and pass it to AdbConnection.create() with an AdbCrypto object that contains a key pair that was either newly generated or loaded from a file. You then cal AdbConnection.connect() to begin the connection handshake process. When that returns, the handshake is finished. You can call AdbConnection.open("shell: killall recovery") and that will create a stream connected to the killall process (so you can send and receive output via stdin, stdout, and stderr). When the process terminates, your stream will close.
Sorry for reviving this old thread, but if anybody is interested in using AdbLib library, it's now available on maven central repo. It is slightly modified version of the library, but API hasn't changed much.
I'm reviving this thread once again
I used this adb library to create a Tasker Plugin!
https://play.google.com/store/apps/details?id=com.ADBPlugin
Please have a look
@cgutman Just a quick question. How do you send the ctrl+c from your app using this library? I can't seem to find it

## PRO-TIPS for your (non-pro) Windows RT ##

Well I guess this is more of a 'list of utilities, commands, and features' that might be buried so deeply into windows rt that you didn't know it was there. I don't know about other surface/winrt users but I have gotten more advanced configuring my surface rt than I ever did on an x86. Now I usually end up needing to configure my x86 devices to provide the same functionality I expect on my tablets.
So I don't think we have a list like this and I'm sure a lot of you have your own 'pro-tips', so maybe we can compile a list of hidden gems we can use with windows rt into this thread so that we collectively can reference or individually don't forget
So here is a short list to start off :
Utilities -- Many more utilities can be found by browsing c:\ProgramData\Microsoft\Windows\Start Menu\Programs
WF.msc (type at command prompt or Win-R key run window) : (Windows Firewall with Advanced Security) although they removed the control panel applet it seems they left in this mmc plugin.
gpedit.msc : group policy editor... somewhat hidden but they left this in
resmon (Resource Monitor)
msconfig (System Configuration)
msinfo32 (System Information)
steps (Steps Recorder) : this is a utility that will capture your activity as screenshots to play back or upload for others to see.
Modify whether links or html files open in Desktop or Metro versions of Internet Explorer :
Open desktop Internet Explorer, click on gear icon and choose Internet options. Now click on 'Programs' tab and select your preference from the 'Opening Internet Explorer' section dropdown.
Keyboard Shortcuts :
Metro snap via keyboard : Hold Windows and tap . (period) Keep holding down windows key and tap left, right, up, or down
Win-Tab : While alt-tab lets you cycle 'desktop' programs, Windows key + Tab cycles through 'metro' app list
Win-X : Show advanced start menu (same as right clicking start menu)
Win-D : Show/Hide desktop
Win-P : Pick from various multi-monitor configurations (duplicate/extend/pc only/external monitor only)
Console Commands
'HELP' : Show a list of all commands you can get more help on.
'WHERE' : Type where wf.msc (for example) and it will tell you where that program/file exists if it is in any of your PATH'ed folders.
'WMIC' : a very deep well of information, type WMIC /? to see list of all modules
wmic volume list brief (shows all mounted drives/volumes)
wmic qfe list brief (shows all installed windows updates)
'SYSTEMINFO' : another system info command, sort of a command line version of msinfo32
'TREE' : show an 'ascii-art' tree of sub-folders for the folder you are in.
'ASSOC' : command line ability to set file associations
'CERTUTIL' : can be used (among other things) for computing file hashes
certutil -hashfile [filename] [MD5|SHA1|SHA256] so for example :
certutil -hashfile myfile.zip sha1
Associations / Context menu / 'Send To' programs :
Create a shortcut to control.exe /name Microsoft.DefaultPrograms to quickly go to this control panel applet.
Use command line ASSOC to set file associations
Manage 'Send To' folder by opening 'windows' explorer, typing shell:sendto into the location bar to be taken to a folder showing all your 'send to' programs'. You can drop shortcuts to other programs (provided those programs accept command line arguments). Now you can right click a file in windows explorer and 'send to' programs like 7-Zip, Paint.NET, notepad++, etc.
Add an "Open with Notepad++" or other top level context menu for all files :
Open registry editor and browse to : HKEY_CLASSES_ROOT\*\shell.
Right-click on “shell” and choose to create a new key, calling it “Open with Notepad++”
Create a new key below that one called “command”
Double-click on the (Default) value in the right-hand pane and enter "c:\path_to_npp\notepad++.exe" $1
To have the menu item show the notepad++ icon do these extra steps :
Right click the "Open with Notepad++" key (which you created) and add a new string value called "icon"
Double click new "icon" value and set its string value to "c:\path_to_npp\notepad++.exe"
In all steps above make sure you enter the path to notepad++ on your machine instead of the path entered.
http://www.howtogeek.com/howto/wind...th-notepad-to-the-context-menu-for-all-files/
Make 'command prompt here' context menu when right clicking folder in windows explorer : http://www.howtogeek.com/howto/wind...-always-display-for-folders-in-windows-vista/
Enable 7-Zip Context Menu :
Run regedit (Registry Editor), and drill into / expand HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers.
Now right click on 'ContextMenuHandlers' and choose 'permissions'.
Click 'Advanced' button.
On advanced Security Settings screen (at the top) choose Change (owner) link.
When selecting a user or group screen comes up click 'Advanced', then 'Find Now', and in search results choose 'Administrators' (may need to widen column to distinguish from singular 'Administrator').
After highlighting Administrators, click OK button to go back to Advanced Security Settings screen.
Now you are able to click on 'Administrators' and click 'Edit' and select 'Full Control' and click ok to apply permission.
Keep clicking ok on dialogs till you are back at registry editor.
Now run 7-Zip as administrator, go into tools menu and select options.
Then on 7-Zip tab choose 'Integrate 7-Zip to shell context menu' and click ok to close dialog.
Context menu should now appear when right clicking on files in windows explorer.
Disabling Connected Standby :
This is only a good idea if your tablet will always be left on a charger or 'shut down' when not in use. If you turn off connected standby and set your display to turn off after... say 5 minutes, then after 5 minutes your display will really power off (backlight as well) but any desktop programs will continue to run. You might want to do this if you are running a web server or some other process in background. When you disable connected standby, many other options appear in your power options 'advanced power settings' page. If you do this I recommend you 'Create a power plan' on the 'Choose or customize a power plan screen first'.
To toggle connected standby feature on or off, modify the :
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\CsEnabled key, setting to 0 for 'off' or 1 for 'on' and reboot to take effect.
Node Chakracore :
This is really an undocumented bonus 'add-on', made by Microsoft which you can run even on windows rt devices which are not in test-signing mode. For those who are not familiar, NodeJS is a console-based javascript scripting environment. Standard Node.js uses v8 javascript engine (same as google chrome), however this 'node-chakracore' version uses the chakra javascript engine (which is the latest version used in edge browsers). Microsoft is providing this for raspberry pi users running Windows 10 on ARM but they also work on Windows RT.
I made a utility here if you prefer to try an automated means of installing
Install Node.JS (node-chakracore) :
Download the latest ARM release from : https://github.com/nodejs/node-chakracore/releases
Extract that archive to (for example) c:\nodejs
Add that directory (which you extracted to) to your path environment variable.
(Optional) Install/Setup NPM (lets you install packages from npm repository) :
Download https://github.com/npm/npm/archive/master.zip, save somewhere.
Extract it to (for example) c:\npm.
Open windows explorer and type %AppData% into the address bar and hit enter.
Within your AppData directory, create an "npm" directory.
Double click on npm folder you just created from windows explorer
Click into the address bar to see the full path and remember (or copy) this path for next step and later.
Save the following to file named "npm.bat" and save into the directory you just created/copied
Code:
@node c:\npm\npm-master\cli.js %*
(If you extracted npm elsewhere, update the batch file to reflect actual location)
Create an etc directory under this appdata npm folder
Create an separate etc directory under your node folder (c:\nodejs if you used suggested default)
Copy .npmrc file from c:\npm\npm-master to c:\node
Rename and get rid of the '.' from the filename so the filename is just npmrc
edit that npmrc file In notepad and add the following lines :
Code:
globalconfig=c:\users\username\appdata\roaming\npm\etc\npmrc
prefix=c:\users\username\appdata\roaming\npm
(make sure to substitute your username in the above this base folder is the folder I told you to remember/copy in previous steps)
Having saved those changes to npmrc under c:\node\etc, copy that file to your appdata\npm\etc directory as well.
Add the path of your appdata\npm directory your path environment variable. If you install global packages they will install commands/batch files into this folder. If it is pathed you can exec them as native commands. This path is also where we put the npm.bat so it can be run from anywhere.
A useful demonstration if you have configured the both npm and node correctly is to install cash (an implementation of unix shell commands) by typing from a command prompt :
Code:
npm install -g cash
That should take a several minutes to complete (hopefully successfully). When done you can run 'cash' or just '$' at a command prompt to bring up simulated Linux prompt from which you can type 'help' to see supported commands. These commands interop with windows commands as well so you can mix (see cash link above).​
(Thanks to @black_blob for discovering this node/npm)
I will add more info or cleanup as needed, feel free to post your own, if needed I can compile it into first post to work towards a guide if anyone wanted to make one.
I modded the Windows 10 Chakra(non-core) to run on 8.1 as a part of my earlier NodeJS port. By the way, I also had Microsoft Edge running with it at a time.(EdgeHTML)
I wonder if I should continue my backports from Win10
You mean other programs/frameworks? You have brought over some great stuff, so yes absolutely! Anything you have in mind?
nazoraios said:
You mean other programs/frameworks? You have brought over some great stuff, so yes absolutely! Anything you have in mind?
Click to expand...
Click to collapse
I have in mind to backport the UWP framework, or maybe even a FrankenKernel(10 kernel, 8.1 userspace). Microsoft Edge works without needing UWP, as you can use edgehtml like mshtml for embedding
You would definitely be my hero if you could bring over Edge, preferably with somewhat recent (EdgeHTML? rendering) and Chakra javascript engine.
Not sure how FrankenKernel and UWP support could work out but both could potentially be awesome... guess its the details which I'm sure you have a better idea than me. So do you think we would be able to run (open source?) Windows 10 apps and would the 'developer mode' be brought over with the kernel or is that 8.1 userspace which would require 8.1 developer license signing (and renewing every 6 months)? Or would the UWP part just be for console or node-chakracore like it is on IOT?
nazoraios said:
You would definitely be my hero if you could bring over Edge, preferably with somewhat recent (EdgeHTML? rendering) and Chakra javascript engine.
Not sure how FrankenKernel and UWP support could work out but both could potentially be awesome... guess its the details which I'm sure you have a better idea than me. So do you think we would be able to run (open source?) Windows 10 apps and would the 'developer mode' be brought over with the kernel or is that 8.1 userspace which would require 8.1 developer license signing (and renewing every 6 months)? Or would the UWP part just be for console or node-chakracore like it is on IOT?
Click to expand...
Click to collapse
Windows 10 kernel & system, Windows 8.1 explorer.exe, dwm and other tiny GUI bits
I have a Windows Server ARM64 build, but that's not 32-bit
Yea that sounds daring... Don't brick your device please Too bad no 32bit gui bits to borrow. I doubt they would bring the Ubuntu for Windows 10 subsystem to arm, but technically i'm sure they could since Ubuntu has arm and pi2 image.... still would be neat. Also I think they added ssh server to pi2 but not sure if it would be easy to 'extract' and borrow.
We will be watching you commander...
nazoraios said:
Yea that sounds daring... Don't brick your device please Too bad no 32bit gui bits to borrow. I doubt they would bring the Ubuntu for Windows 10 subsystem to arm, but technically i'm sure they could since Ubuntu has arm and pi2 image.... still would be neat. Also I think they added ssh server to pi2 but not sure if it would be easy to 'extract' and borrow.
We will be watching you commander...
Click to expand...
Click to collapse
The Ubuntu support uses the Linux binary compatibility SubSystem, also known as Astoria
black_blob said:
I have in mind to backport the UWP framework, or maybe even a FrankenKernel(10 kernel, 8.1 userspace). Microsoft Edge works without needing UWP, as you can use edgehtml like mshtml for embedding
Click to expand...
Click to collapse
That would be even more amazing than a running build of Windows 10 Mobile. So you'd have a "full" OS with the befinits of running UWP. That would def. insure the future of Windows RT.
It would be even better if astoria would work on it too. So you'd even able to run android apps.
I need help for the nodejs and the npm instructions. Can you explain it out in details for morons?
Sorry late reply... which steps are you getting confused at (for node/npm install) ? So for starters :
- if you open a command prompt and type "node -v" does it tell you the version of node your running? If so, what version does it say?
- if you type "npm -v" does it tell you the version of npm you are running or give an error? Tell version or error.
So i'll start with that to make sure your paths are set up.
I created an installer utility to install node-chakracore along with NPM. Hopefully this will make it easier for other or myself to install or upgrade as new versions of node-chakracore and npm come out.
The final step in the process (updating the system PATH environment variable) requires admin permissions so right click executable and run 'As Administrator'. If you prefer to set the environment variables yourself, this step will tell you the paths it would add.
9/13/16 : Updated default node chakracore download link to new 7.0.0-pre9 release, added a 'Complete' tab with links to further resources and made UI fix

Categories

Resources