Wednesday, November 24, 2010

Should Benign Bladder Polyps Removed Or Not

Python For Android - Myth or Reality

few hours I was researching the possibility of developing with Python on Android and then give you a summary of the results and conclusions that I got.

Here I give you the script I used to try some of the widgets available in the API if they want to try and have a look (I do not stop to explain much because the code is virtually self-explanatory). Also suppose that followed in the footsteps of my tutorial on How to develop for Android? and have configured your development environment and know how to use the emulator.

droid = android.Android ()

time = droid.dialogGetInput ("Enter the amount of time you want to demo (10-100)", "Time:") print

time
time = int ( time [1]) if time
< 10: tiempo = 10elif tiempo > 100: time = 100


droid.dialogCreateHorizontalProgress ('Bar Progress ',' Hello, I'm making progress ...', time)
droid.dialogShow ()
for i in range (time):
time.sleep (0.5)
droid.dialogSetCurrentProgress (i)
droid.dialogDismiss ( )

droid.dialogCreateSpinnerProgress ('Spinner of progress',' Look, look ... I'm spinning ')
droid.dialogShow ()
time.sleep (time)
droid.dialogDismiss ()

droid.notify (' Python Test ',' Oh, I can also report ')

droid.dialogCreateAlert (title, message)
droid.dialogSetPositiveButtonText (' Yes')
droid.dialogSetNegativeButtonText ('No')
droid.dialogSetNeutralButtonText ('Cancel')
droid.dialogShow ()
droid.dialogGetResponse response = ().
result
droid.makeToast response print ('The result of the execution of the button is:% s "% response [' Which '])

droid.dialogCreateAlert ('Select a color')
colors = ('yellow', 'blue', 'red')
droid.dialogSetItems (colors)
droid.dialogShow ()
droid.dialogGetResponse response = ().
reply result print
droid.makeToast ('The selected color is% s'% color [response ['item']])

droid.makeToast ('Well, bye')


To run must install some packages in the cel. They can do this with SDK command:

$ adb install / path / to / archivo.apk

with QR are the project page SL4A or the method they see fit.

Ok, things to install are:


After the install go to device / emulator and look for the icon For Android Python, tap and install . That will take a few minutes while you download some stuff. After then send the test script at cell, we can use the command:

$ adb push / path / to / script.py / sdcard/sl4a/scripts /

This will copy the folder SL4A. Now when you run the Python For Android will see in the list of our infamous creation scripts, tap on the script and run. The rest is to enjoy the windows and controls: P

Conclusions


    SL4A
  1. The API is small, ie is well underway although there are still many things / features to be implemented. Python For Android
  2. unlike what I thought graphics do not support Android widgets, but notifications, toast and basic things such text entry, selection, etc.. So forget about image-rich graphical interfaces and stuff.
  3. Yes there are some performance Issues, actually a buddy who is working hard with Android developers tells me every day are killed for trying to improve performance in itself because it is a little slow (I mean native apps). However, the version of Python is cross-compiled and run even faster than Jython
  4. There are ways to package scripts. Apk and although something a little experimental work quite well (they are, say, "tweaks" construction method Java packages)
  5. As there are no major Issues stability can be used for production applications


Finally I can say (much to my regret) we can not have this alternative for developing rich GUI applications, but it is an interesting option to consider when it matures a little more. Personally I will watch and wait ninja forward in the future we can create applications as good as with Java.

More information: *
http://code.google.com/p/android-scripting/
http://code.google.com/p/android-scripting/wiki/FAQ
* http://code.google.com/p/android-scripting/wiki/Tutorials
* *
http://code.google.com/p/android-scripting/wiki/ApiReference

Saturday, November 20, 2010

Can I Get A Brazilian Wax If I Have Pcos

How to develop for Android? - Part I



Nowadays I have seen the need to create applications for Android and as there had dabbled in that world, I decided to make a series of articles to document the entire process.

In this first post I'll explain the steps I followed to bring about the development environment. I might mention that the recipes are made for Debian GNU / Linux, yet you can adapt it to your favorite distro with some minor adjustments.

For those not familiar with my tutorials I remind you that all instructions start with the $ character as the user running normal and starting with # are run as superuser (root), eg

$ ls-l (command run as user)
# aptitude update (command run as root) That said


started. Install dependencies


The first thing to do is install the packages needed for development, which basically are: Java Virtual Machine (JRE) and the development environment (JDK). On a Debian GNU / Linux suffice:


# aptitude update # aptitude install sun-java6-jdk sun-java6-jre
# aptitude remove gcj-jdk


If they realize SUN implementations use and removed any possible installation of GNU Java compiler (gcj) as the official documentation tell us that gcj is NOT compatible with Android.

For more information about system requirements visit: http://developer.android.com/sdk/requirements.html

Then install the packages that we ensure that the system select the correct options for each default executable, stop it use:

# update-alternatives - config javac
# update-alternatives - config java


And in both cases, we select the options SUN. Install Ant


Ant is a tool that allows us to build Java applications. In our case, we will compile and build files. Apk (the installable Android) from our source code.

We go to the download page Ant, download one of the archives found in the "Current Release of Ant" and unzip it in a folder of our choice. In my case I did it in / opt and I had the folder: / opt/apache-ant-1.8.1 .

Install the Android SDK
Well, having the tools and units ready, we will install the Android development environment. We go to the page Android SDK and download the appropriate version for your platform. As with Ant, unzip the file in the folder of our choice. This time also unzipped into / opt, staying in the folder: / opt/android-sdk-linux_x86 .

Now edit the file ~ /. Bashrc to add the path of the binaries to the PATH system and set the environment variables ANT_HOME and JAVA_HOME. We achieve this by adding the following lines:

export PATH = $ {PATH}: / opt/android-sdk-linux_x86/tools
export PATH = $ {PATH}: / opt/apache-ant-1.8.1/bin
export ANT_HOME = / opt/apache-ant-1.8.1
export JAVA_HOME = / usr/lib/jvm/java-6-sun/jre


Remember to change the paths of these variables on routes where your binaries. If you do not know where to point JAVA_HOME did you run the command:

# find /-name "tools.jar" 2.2) and need at least one
to compile the application and configure a Virtual Android Device (AVD) for testing.

This is very simple, just open a terminal and run: $
android

will appear a application (AVD Manager) as shown below and there we go to the Available Packages section


, update the repository and select the (s) platform (s) you wish to install.



Finally we created a new virtual device Virtual Device section. We click the button
New. ..
, We assign a name, select a platform and click on Create AVD.


To test our brand new device is selected and click on Start ... . Then click Launch and after a few seconds we will have the emulator running an instance of Android:)


Now comes the fun part, create the application. In the next installment will be speaking on the development, for now can play creating a Hello World and can read about how
and develop with Eclipse how to develop with other IDEs
Compile and build the executable

After we have our application ready to create the installer. That's as simple as navigating to the root folder of the project (source code) and run: $ ant


debug If our project is called "HelloAndroid" will generate a file-debug.apk HelloAndroid and that is our installer . Test in the emulator

Finally, one of the most expected. How will our application on a device? For easy, on a console, run: $

android


E

begin our virtual device. After the device is working on another console run:

$ adb install / path / to / your / installer / HelloAndroid-debug.apk

And with that, send the application to the device. We looked at the menu and voila! A play: D


I hope you have this tutorial useful. Soon I will continue documenting my journeys in the world of Android. Over and out.