i'm currently reading through head first python and upon reaching chapter 8 I got stuck. The book wants me to download SL4A from the link http://code.google.com/p.android-scripting however that link no longer works. So I did some searching and found the file on github. My real problem is when I try to download it on the emulated device it just says waiting for data connection and it never downloads. I am wondering if there is a way to fix this. Any help is appreciated thanks!
EDIT: to get it to work I downloaded both files from here https://github.com/kuri65536/python-for-android/blob/master/README.md
then I copied the files to the folder
C:\Users\lucas\android-sdks\platform-tools
then I opened CMD and cd to the path above.
then use the command:
adb install (filepath)
for both files and they appeared on the emulated device.
Download to your pc and push through ADB.
Download files and adb install worked for me in my installation (Windows 10, android studio 2.1.1) with minor differences:
1) adb command is located in:
C:\Users\MyUser\AppData\Local\Android\Mysdk\platform-tools
Need to add to path
2) Needed release sl4a-r6.1.1-x86-debug.apk. Downloaded it from release pages
I'm also reading through HeadFirstPython and got stuck at this stage (with the error: app not installed). I tried the abs method above and ended up with yet another problem: install_failed_no_matching_abis. After a lot of research, I got to understand that the "native libraries" of the sl4a.apk were not matching the system architecture of my emulated android. In other words, if one wants a faster emulator in android studio, he ought to use an x86 architecture android; but the problem with that is scripting layer for android is programmed to work on ARM architectures hence the 'install_failed_no_matching_abis' error.
The solution that worked for me was to go back to AVD in Android Studio, delete the downloaded emulator (which was of x80 cpu/abi) and download one with armeabiv7 cpu, recommended level=24. It took a lot of trial and error to get to this choice as other android cpu/abi were either too slow or just wouldn't allow me to install the required apps.
Edited: In the end, I was directed to use GenyMotion as that performed better in terms of speed. I was reluctant at first but, to my surprise that really is the case (It is super faster than ARM android studio alternative). Not only is it a great emulator, it also has this ARM translation tools that allows one to easily install ARM sl4a.apk on the x86 devices.
Related
I just ordered a Nexus 9 and will be using it to program. Has anyone tried to run Terminal IDE on Nexus 9 or any other devices using Android 5.0 Lollipop?
The "links" browser included with Terminal IDE ran fine on my Nexus 5 under KitKat, but it crashes with the PIE error mentioned under Lollipop. Other than that, Terminal IDE has performed flawlessly for me, for about a year now. Sorry--forgot to add: Terminal IDE under Lollipop is "stopped" if started with the Android keyboard, or Android keyboard option is toggled. It will resume running if the Terminal IDE keyboard option is toggled.
7175 recompiled all the Terminal IDE binaries statically, so they don't give the PIE error on Android 5+. http://forum.xda-developers.com/showpost.php?p=57292384&postcount=68 (dec 2014)
7175 recommends downloading the apk from the following dropbox, then unzipping (an apk is a zip) and copying across just the binaries you need (instead of sideloading the whole apk).
https://www.dropbox.com/s/h2d23ecbrt2akeu/terminalide-2.02-binary-mod-signed.apk?dl=0
I downloaded this, and its vim worked on my old 4.2.2 Android phone - but I haven't actually tried it on an Android 5+ phone! (I don't have one; I'm researching my upgrade path).
At lease one stackoverflow user uses it: Rejecting re-init on previously failed class error when loading a Class with dalvikvm
A question within an answer: Anyone know how to confirm these binaries are safe? Especially ssh - downloading a "secure" shell binary from an anonymous user defeats the purpose!
The background of the post seems 100% legit, and has 467 "thanks" (wait, that's for all 7175's posts; this particular one only got 2 "thanks"...) - presumably people who downloaded it, and found no problem. But the site seems dodgey (http://forum.xda-developers.com), with lots of ads and security warnings. Maybe they are recent, after these older posts, and xda used to be good?
Terminal IDE appeals to people who don't want to root their phones - who probably don't want to sideload apps, or download anonymous binaries off the internet. I think the Play store does some rudimentary verification, and the more people who use it, the more likely problems are found. So it would be reassuring if spartacusrex could release this on the Play store as an upgrade - or, 7175 release a new fork.... or someone else release one. Forking is one of the strengths of open source!
BTW: I feel really bad doubting 7175's kind and great work, but sadly, security is a real issue. :(
No, but termux seems like a good Terminal IDE replacement for Lollipop - and under active development. Has vim, ssh, git, gcc etc and a version of apt-get.
[It only works in Android 5+, so I haven't tried it yet myself.]
Edit: It looks like it's not working on all new devices, maybe a target SDK version incompatibility? Terminal IDE should work at least on some other devices since it uses statically compiled binaries to run different parts of it. Statically compiled binaries are PIE(position independent executable) safe which is a requirement in lollipop. I've been running it on a lollipop build with my Galaxy Nexus no problem.
EDIT2: Also there are a few binaries that are dynamically linked and are not PIE, so those won't work.
You have lot of options now:
* Termux
* GnuRoot apps
* UserLAnd
* KBox
Of course, it should be possible to build a great filesystem yourself with fakechroot, fakeroot or proot. Or a non-root package manager.
I remember seeing a project named like 'Gentoo prefix for Android non-root' on Sourceforge. I don't know if it is still at alpha stage...
I'm jumping head first into Android for Google Glass development and I'd like to know how I can let my client see the .apk that I'm working on.
My client owns a pair of Google Glass too but lives far away.
So far, the only way I have been able to upload to Glass is using ADT, Run As -> Android Application when my Glass is connected by USB.
How can I put the Glassware (apk) up online so he can "load it up" into his glass remotely? Or deploy it to his glass?
I read Send the .apk file to client for review but it's more related to Android devices, whereas my client uses Google Glass and doesn't have debug mode on (I can ask him to turn it on though) and won't root his device.
You might want to have your customer use ChromeADB -- you can see it here: https://chrome.google.com/webstore/detail/chromeadb/fhdoijgfljahinnpbolfdimpcfoicmnm/reviews?utm_source=chrome-ntp-launcher
From the comments it looks like other people are using this for similar situations.
I suppose your client owns source code so they may be glad to download the SDK at http://developer.android.com/sdk/index.html and install ADT then use the Android SDK Manager to install the SDK Platform, so they can either get your updated source and install it to Glass from ADT, or run adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb install .
Well my client has the Android SDK installed on his system and he just turns on the usb debugging mode on on his glass. Then he installs the apk using the adb install app.apk command
So far there is no other option available than this.
For Installation and testing on client side one need to follow below mentioned steps.
Download this android-tools.zip to Windows PC and extract it using any unzip tool
Copy the desired APK file (Say testapp.apk) to the extracted folder i.e in android-tools
Now open command prompt Win -> Run -> cmd -> ok
Run this command adb install testapp.apk
adb is open sourced, it shouldn't be difficult to wrap it up in a standalone application or you can rebuild adb and dependencies (due to binary license you can't simply redistribute you need to build the AOSP based code which is distributable - but IANAL)
If wrapping up commands (easier route) you can refer to these command line scripts to uninstall and run by simply passing the apk file name:
How to start an application using android ADB tools?
Hopefully this helps...
But you could use BlueStacks and have the client install the APK into the program. BlueStacks will setup a preference for ".apk" files to open up in the program itself, So no command line ADB is required. I dont know how well Glass APK's will run, however the BlueStacks emulator has come along way and work well with most general applications. So if your client has either Mac / Windows, they can easily setup an the Android emulator and can run your APK's. They could always just setup the Android SDK and use the standard emulator, It still will wont resemble a Glass device, however this could help the client understand what you are doing in the app. Its worth a try at least.
I am trying to generate trace reports with Systrace tool in the Android SDK, but I cant view the report in the browser. It is blank and does not contain any information. I read in some forums that I need to open the report in Chrome browser, I opened it with Chrome as well but the report is blank.
I have enabled USB Debugging from the Developer Options and device is running Android 4.2 and I am using DDMS tool from the Android SDK to generate the traces.
http://developer.android.com/tools/help/systrace.html
Firstly, if anyone is using Chrome v50.0+ on OS X or Windows, just try this please.
open chrome browser and go to "chrome://tracing"
in the tracing page, click load and select the systrace generated html file.
Secondly, I think it's a bug which is confirmed by Google.
It looks like this is because modern versions of Chrome have deprecated the Object.observe function[1][2].
For more information, please see this, https://code.google.com/p/android/issues/detail?id=57135
I also have this problem running chrome on linux.
It seems they have bug in the implementation of javascript drawing the results.
Check JavaScript console.
Mine says.
Uncaught TypeError: undefined is not a function
On Windows , I just can see the result by doing this:
get the trace.html
open trace.html with chrome browser and open the chrome's developer tools then i find out there is 3 error in trace.html
showing like this
go to the error line ,then comment the error function
like this
save the modified html then refresh chrome , you can see the trace result
This is just not the best solution, but any way we can see the result.
I was having the same issue when capturing through eclipse on Ubuntu 12.04.
Worked around it by running the tool directly from the systrace folder (sdk/tools/systrace/)
./systrace.py -t 5 -o trace.html
Update your SDK using SDK manager, select tools and platforms tools to be updated.
Follow the normal procedure, and that's it. Chrome is recomended to see results.
I solved this issue just by updating the SDK, use the SDK manager select tools and platform tools for update and you're done. Python script doesn't work on Windows.
However even if the trace.html is generated and it can be seen, when data overflows, it is not possible to see the bottom part of the page. This because wasd navigation is not enough making the use of the scroll bar needed.
To do this you need to:
If you're in Linux modify the Python script and eliminate the overflow:hidden wherever is found.
If you're using SDK, edit the trace.html and eliminate the overflow:hidden wherever is found.
Hope it helps, it'll be nice that someone in Google can fix this on the source.
I just found the my trace.html, which failed to open in IE/Firefox/Chrome, opened fine in the latest Opera (on my Windows PC).
For me, it didn't work on Firefox v34 but worked in Chrome v37 and I am on Ubuntu 12.04.
I also faced similar issues while trying to open a Systrace generated html file (around 10 MB ) on Firefox 37.0.1. However the same file works brilliantly on Chromium Version 37.0.2062.120 Ubuntu 12.04 (281580) (64-bit).
I've done following:
cd $ANDROID_HOME/platform-tools
git clone https://android.googlesource.com/platform/external/chromium-trace/
mv systrace old-systrace
ln -s chromium-trace/catapult/systrace/systrace/ systrace
that fixed my systrace issue
systrace report work in latest chrome at least
You can try my sample trace.html file to check if your Chrome version is okay or not.
https://github.com/tngotran/systrace-android/blob/master/trace.html
Also here is a link to the official trace.html sample from Google https://source.android.com/devices/tech/debug/perf_traces.zip
By the way, from my experience, the command tool python systrace.py can create an output file trace.html without error, but result is an empty file (even the file size is larger than 5Mb or more).
We have to:
Run the command adb root from your terminal to restart adbd as root
Run the python systrace.py again
Then check your created report .html file in Chrome :)
Suggestion: Try to trace an emulator (they are for development)
The issue may be manufacture customization to the Android OS, making the problem potentially a device configuration issue caused by the manufacture.
There are several answers that may be helpful here.
None of these worked for me... but because of answer https://stackoverflow.com/a/52379567/1815624
I found that it would load data by using the linked trace files:
Also here is a link to the official trace.html sample from Google
https://source.android.com/devices/tech/debug/perf_traces.zip
Using adb root did not work.
On a different device it worked flawlessly right off as well as using an emulator.
I have followed the instuctions as posted on http://source.android.com/source/index.html to build an Android Source Environment. I am using Ubuntu 10.04. The process went without problems. After hours of downloading the Source Tree (I Have tried several including 2.1 and 4.0.1) and execution of the make command all image files were created in the directory '/WORKING_DIRECTORY/out/target/product/generic' except the boot.img file. I read across the internet that it is possible to create an own boot.img file using 'mkbootimg'. However I would like to avoid this in first place and use this option only as a last resort, because I am not familiar with the process as it requires some header files I am not certain of where to find them. I am curios why the boot.img file was not created.
Is somebody facing the same issue or maybe has solved the issue?
Best Regards
You've built your image for an emulator. Thus, you not need an boot.img to run an emulator and that's why it is not in your directory. You should make build for a particular device. If this device is Google device you'll have no problems - just follow the instructions on the webpage: http://source.android.com/source/building-devices.html
When developing on BlackBerry or iOS, you can deploy your application just by dropping the compiled code into a special directory, and when the simulator boots up it will check that directory and install any apps that it finds there. Is this possible for Android?
The reason this feature is desirable is because my build system deploys builds nightly. I want the emulator ready to go when my QA team gets in the next morning. To do that, I have to write a script that boots up the emulator, waits for it to start up, then calls adb install and finally shuts down the emulator. It would be great if I could just drop the .apk in a directory and have it ready to go the next time QA boots up the emulator.
Edit:
Someone asked for the script I described above. It's unfortunately written in Perl, but here it is: http://pastebin.com/6UcNgYRs
Edit 2:
I just found an awesome little command that can help you if you're trying to write a script like the one I mentioned above. You can have your script wait for the emulator to come online with the command $ adb wait-for-device!!
Is this possible for Android?
No, sorry. Nice idea, though.
You can just tell the QA people to use the install script as the emulator itself, just remove the "close the emulator" bit.