How can I install sl4a modules without internet access? - android

I have the necessary .zip files in the root directory of /sdcard. The language installers insist on using the internet. I'm thinking the .zip files are in the incorrect directory. What directory do I put the files; or if that is the wrong question, how can I get any of the sl4a languages installed?

sl4a supports .yak files . sl4a works on Android Emulator as well.To use, use adb install sl4a_rnn.apk

Forget that those files are even available for download. Use the built-in mandatory installer only after giving up at trying to integrate sl4a into my Eclipse workspace; because there is already a free distribution of Python in the Google Play store :)

Related

Mobile Firefox development directly on my (rooted) Android instead of having to repack and reinstall the fennec APK for every little edit?

For mobile Firefox development, how can I hack the core javascript directly on my (rooted) Android so I can get instant results instead of having to repack and reinstall the fennec APK for every little edit ?
The problem is that all the files are locked up in the /data/app/org.mozilla.fennec/base.apk, and within that there is another archive (/asses/omni.ja) which can be unzipped to give the javascript. Reconstructing the apk file on device after editing the zip file inside it has proved unworkable, as although the apk file can be unzipped, it does not work when simply zipped back up again.
The goal is just to try things out and learn the workings of Firefox on device and on the go.
Android install the app to a directory in /data/app/[package name]
You should be able to find the directory for this browser using the package name.
Then you can edit the javascript files in that folder but you might have to restart the app.

Porting C based linux application to the Android platform

I have C Linux based application and now I want to port it to Android.
I figured out, that I can extract the toolchain from Android NDK and build my application, but how to make the APK such that I can install it on the android devices without the need of root access.
In Linux, I used to install it using a bash script which used to put my application related files in different folders like /opt, /etc (files shared with other applications) and /var . How can we handle this in Android. Is there a folder similar to /etc in Android where I can put files that other applications can read.
Thanks
-M
First of all, you are lucky if your project compiles "as is" with NDK standalone toolchain. Often, bionic is not enough, and people need to tweak the build environment (from libpthread to full-blown buildroot alternate toolchain with static C runtime).
As for the shared files location, on Android it's named "external storage". Your app and other app may require special permissions to write and read to this location. Directory /opt does not exist here. You don't have write access to /etc, but files like /etc/hosts are available for read.
Regarding the APK. You are right, this is the ultimate way to distribute and install apps on Android. But you can, even without root, to locally install and run a command-line executable. Usually it's done with Developers Options turned on, and enabled USB debugging. Now you can open an adb shell, install and run your program. The trick is that external storage (see above) is marked as 'non-executable'. Therefore, you must find another place for your binary. Usually, /data/local/tmp will be a good choice.
Instead of adb, you can use a terminal emulator on the device.
If you choose to build an APK, you will probably prefer to convert your app to shared library that will perform actions for Java via JNI. But it is also possible to package your command-line binary as part of the APK and use Java Runtime.exec().

How do I run Android's .apk files on linux without the Android emulator?

I have a requirement, where I need to install the .apk files directly on my host PC, without the Android emulator. I want to install it directly on my Linux machine (x86 arch). I have a few noob questions with regard to the same:
How is an .apk file organized?
Is it just one big binary file?
In this case, if I am using a phone with an x86 atom processor, does this mean that there will be a separate Android market segment which hosts apps ported to the x86 arch?
Is it an archive consisting of executables? (something like .rpm or .deb).
If so, then what is the format of the archive?
If so, do they have different .apk files for different architectures (x86, ARM, etc.).
If not, then how is it orgranized?
What are the requirements to run the .apk file directly on my Linux PC running on x86 arch?
I do not have a very good background of Android and the .apk files, hence these questions.
Thanks and regards,
Hrishikesh Murali
You cannot install .apk files directly onto your PC. Even though Android uses the Linux kernel, the applications runs on a totally different platform. APK files are ZIP file formatted packages based on the JAR file format, with .apk file extensions. They hold all of that program's code (such as .dex files), resources, assets, certificates, and manifest file.
They run only on the Dalvik virtual machine.
Install Android OS on your PC, if you really want to run them from a computer.
You can use the ARChon to run apk in ubuntu:
Install the ARChon Runtime.
http::github.com/vladikoff/chromeos-apk/blob/master/archon.md
Open and enable the flag: chrome://flags/#enable-nacl,then restart Google-Chrome. (Important!)
Install existing android apps in the website or convert your favourite android apps by "Online APK-CRX Converter.
Drag and drop the Google-Chrome extensions into the chrome://extensions/ page in the browser and it will be installed in your browser. Enjor it!
An apk file is not an executable, it's just an archive file contaning all the resources and class files that are to be used by the application.
The apk is set to be unpacked and run by the Dalvik vm.
The elements that are contained inside the apk file are specifically designed and designated to be used in Android mobile phones and not a desktop PC running Linux. Though Android uses the Linux kernel, you definitely cannot run the apk file on a Linux machine, as you would an rpm or a deb file.

How to use tweepy module with sl4a and py4a?

I am trying to build a twitter client written in python using tweepy and make it run on sl4a (using py4a) on Android. But i seem to fail to import tweepy module in my main script. The script does not run. Please tell me the correct way to use tweepy in sl4a because copy-pasting the tweepy directory in sl4a's scripts directory does not work.
Download the tweepy .egg for Python 2.6 here : https://pypi.python.org/pypi/tweepy/1.7.1 Make sure it is in the Downloads folder in your SD card. Launch the Python for Android app and select the "import module" option. Select the tweepy .egg file you just downloaded. It should work fine.
The Python for Android app allows you to import module zips, and there are instructions around the web and on the SL4A FAQ about where to copy modules to on the SD card to try and install them as well as installing Python Eggs [link]. You could also try running tweepy's setup.py (found in the download) on the phone.
However, it may also be possible that tweepy has other requirements not present on your phone, such as other modules that would normally be installed by easy_install or the like. While I don't think this is the case it would certainly make installing it very difficult.
At the end of the day, as per the FAQ, I think your best bet is to try copying the tweepy module directory into /sdcard/com.googlecode.pythonforandroid/extras/python.
Good luck!

Download scripts for Android Scripting Environment

Downloaded ASE from google code, and was looking through tutorials, and available scripts.
I found a script I wanted to try, however copy pasting it is removing all whitespace (and this is a Python script...).
Is there a simple way to download a script from the internet into the Android Scripting Environment?
Copy the .py file to your SD card, under ase/scripts

Categories

Resources