Python for Android Apps - java

I've learnt python recently and I want to make an app for android. But everywhere on the net, it seems Java and Eclipse are the only ones that can be used.
So, my question is:
1) Can I use python to make an android app?
2) What kind of platform should I use to make an app with python?
Thanks guys!

If you're just looking to run Python scripts, try QPython.
If you're looking to make your Python code run like a native app, or just something more robust than the above, try SL4A.
If you're looking to effectively use Python as a library, and compile an .apk with the Python library included, try Kivy: github.com/kivy/python-for-android.
That said, you'd likely get a lot of benefit from learning Java, and not just for programming natively in Android (which would give you access to a much wider feature set and make your app run more efficiently).

Check out the Scripting Layer For Android, aka SL4A.
Here is a blog for getting started. The blog promises more entries in the series but there don't seem to be any. Still, it is a great starting point. There's quite a few parts to pull together so be patient and check the bottom of that blog entry for dozens of useful links.
If you want to contain everything to the Android device, including the IDE (pretty slick), check this out.
Here's a book from APress that could help with more advanced concepts: Pro Android Python with SL4A

Related

can i develop a multiple platform project -windows/Android- entirely with a single cross-platform language?

as i'm still learning, i'm not sure what tools, frameworks, even languages i'm gonna work with..
so i'm working on a simple project that got windows side and android side.. that obviously needs at least 2 languages to get it done, but it's impossible that i can learn those languages and know how to deal with their frameworks to get the job done
so is there a language i can develop the entire project(windows & android) with, and without need to any other language no matter what or how many tools or methods im gonna use to make it work?
-note: i know java is essential for the android side, so that's the point im talking about.... "entirely"
I would recommend you giving a loot at Flutter, it's not like native windows but it can produce applications for Android, iOS and web with a single codebase. It's really intuitive to use and the apps built with it work really well.
You can also take a look at React Native expect you need a Native app that you have to use Java as the core language if not give a trial to this
I notice you've tagged this with C#. To answer your question: that. You can write Android apps in it as well via a library called Xamarin that Microsoft bought out and has integrated into the platform.

What are the limitations of Python on Android?

I am getting ready to start a little Android development and need to choose a language. I know Python but would have to learn Java. I'd like to know from those of you who are using Python on Android what the limitations are. Also, are there any benefits over Java?
Most of the points mentioned by Andrew stand, I just wanted to mention that python can be and is used for full fledged Apps published on GooglePlay and even iOS. I can't speak for other frameworks but here are some examples of Apps published using Kivy.
Process Craft Google Play iOS
Fantasy War hammer
PreseMT is a multitouch presentation maker
Memo robots
Ground Truth
Kaleidoscope
Showcase demo example from Kivy project
DefelectTouch game iOS
Bargenius and many more...
On Packaging we have tried to make it as simple as possible, we also provide
A pre-built VM that can be used to make your apk with you having to do nothing except
copying your project dir over and running one command.
On GUI, yes the ui is custom, by default(tries to match Android's Holo theme). However it can be customised to resemble other look and feels, although I haven't tried it personally.
Oh and as long as one is talking about python based apps on android, I found this project mentioned on stackoverflow PyMob, their apps page mentions some interesting apps .
I investigated this recently for similar reasons. My conclusions were that I could not use Python to develop a native-looking application, which is what I wanted at the time. Specifically:
Python can't receive callbacks from the Java UI classes, so you can't use any native Java UI elements such as ListView, etc. Only dialog boxes etc. are easily available. If you have a totally custom UI such as a game, you can try PyGame for Android, or you could look at Kivy, which also uses PyGame.
Packaging of Python applications is very difficult, especially because the Python interpreter is not included on Android by default. The Kivy and PyGame teams are making some intermittent progress on this.
Because of the aforementioned issues, Python is essentially never used to make full fledged applications published in the app store, and so the literature on how to handle the many sundry issues with SL4A (Scripting Layer For Android) is very thin.
So, if you want to make an application that uses native UI elements, that you can actually distribute in the Play Store, or both, Python is regrettably not an option.
I have developed Android Apps on the market, coded in Python. Downsides:
Thus far my users must download the interpreter as well, but they are immediately prompted to do so. (UPDATE: See comment below.)
The script does not exit properly, so I include a webView page that asks them to goto:Settings:Apps:ForceClose if this issue occurs.

Resources for Android absolute beginner

I am a complete Android and C in general noob,
I have done a lot of web programming (which I am imagining is largely irrelevant here), some javascript (not jQuery just raw JS), I have also developed a .net app and done a course in java programming at uni last semester,
I know that Android uses Java in some places and C in others, I have looked at the SDK documentation here: http://developer.android.com/guide/topics/appwidgets/index.html
My aim is to build a simple dashboard widget that pulls data on a minute-by-minute basis from a JSON/JSONP API, I have thus far struggled to find any decent tutorials for real Android noobs such as myself, especially in the app widget category, If anyone knows of any good resources (online or books are fine) consisting of basic good practises, start-up guides and quick tutorials to get me up to speed would be great as I have absolutely no idea where to start (especially in the C end of things), I have found the SDK documentation does have some good stuff but it isn't exactly what I am after (built on very old builds of Android and thus most of the cool new features aren't integrated or taken into account).
Any recommendations would be very much appreciated!
On a side note, If all goes well with Android I would also be looking to move onto iOS so Objective-C start-up and tutorials would be great (Visual Quick Pro guide style would be perfect!)
I personally started reading and understanding the Android Application Fundamentals. Then I downloaded the Android ADT (Development Toolkit), configured it on Eclipse as well as the SDK (including samples).
Once that's set up, I started with the ApiDemos. You find its source code directly in the downloaded SDK <sdk-install-location>/samples/android-9/ApiDemos. Try to debug the code in the IDE, modify it and see how it reacts.
Finally, have fun :)
Well, I started with the Android developer documentation:
http://developer.android.com/guide/index.html
If that isn't as organized as you'd like for a complete beginner, you might want to try the FAQ since they have a lot of good tutorial links there, which happen to be very thorough:
http://developer.android.com/resources/faq/index.html
Once you get the basics, which the tutorials will do for you, the first link to the developer guide will be where you'll spend most of your time. There are even links in the guide for getting started with your IDE of choice, or getting started using no IDE at all.
To get a more specific answer, you'll have to ask a more specific question.

Can a systems developer with NO Java programming experience write Android Apps?

I am basically a embedded systems programmer on linux. However, I would like to try my hand at writing Android applications. With no previous Java experience, are there GUI toolkits or something that can help me. Or is it mandatory to learn Java.
Any links, tips for newbies like me will be very helpful
There are various app builders available for those who do not want to do any programming but they are very limited in the apps they can produce. Basically, such builders offer the developer a series of templates which the developer personalizes before building the app. For instance with a video player template, the developer would choose the look and feel such as background colors etc but the rest of the app would be fixed.
Here is an article that looks at some things to consider before using a No-Programming app- builder
http://hypernextandroid.wordpress.com/2012/09/04/coding-and-no-coding-app-makers/
As you are already a programmer and the Java route is extremely intensive then you could try Basic4Android, HyperNext Android Creator etc. These have much easier learning curves than the Java/Android SDK approach and can still produce native apps.
I am 2 months late, but I have been using a software called Titanium Studio to develop android apps. You cannot write advanced apps like games, but its good for developing simple apps. If you have a mac, then you can develop for iOS as well.
You will basically use javascript and PHP to write your app, which are much easier than learning JAVA.
Cons-
It includes most of the commonly used functions from android, iOS SDK but it is missing a lot as well.
The size of the apps will generally in range of 10-20 MB.
Apart from that, If you want to create a simple app and want to do it quick Titanium is the software to use.
Yes you can. You just require an Android tutorial to get started. Try foolowing links:
One
Two
Three
Four
Its better if you first try learning some basics of Java and then try for this.
Hope this helps.
yes.
App Inventor for Android - its simple and easy, no need of any prior Java programming knowledge
Eclipse with ADT plugin - the better way to develop applications - start with Hello World
For UI development - try inbuilt UI editor with ADT plugin or DroidDraw
Gotta learn Java. But if you're familiar with C then the syntax will be familiar. It's object model is pretty simple and it's libraries are great, so it should be fun. Android, of course, has it's own constraints and best-practices.

Starting with Android: Java or Python (SL4A)

I just ordered an Android smartphone and want to start playing around with creating my own applications. Now the question is which language to use, the native Java or Python using SL4A (former ASE).
I tend to Python, as I know it much better than Java, but I'm wondering what I would be missing using a "second class" language on Android. On the SL4A website it is also stated to be alpha quality software, which is not exactly encouraging.
I'm also not quite sure what the limitations of the scripting environment are and if they would be problematic.
At the moment you cannot create a releasable program with Python (or any other scripting language) using SL4A. I have heard rumours that this is something Google is working on, but even if they do enable it Python apps are likely to be slow and power-hungry compared to Java. Also the scripting API only gives you access to a limited subset of the native Java API. I would not consider using SL4A for serious development work at the moment, only for one-off scripts and prototyping.
Take a look at Scala. It is a statically typed language on the JVM, but uses type inference to remove most of the noise that you get in Java. It also fully supports functional programming, and has a lot of pythonish features. Because it is statically typed it is as efficient as straight Java with none of the disadvantages. IMHO it is the language that Java should have been in the first place.
A lot of people are blogging about using Scala on Android, so Google around for more information.
More likely will depend what type of applications you will develop.
I would start with Java to become familiar with Android SDK. Anyway first you need to look into some examples, tutorials. Most of them are done in Java, and only a few, probably on the dev site of SL4A for that.
Also there is native development Android NDK, that can be programmed with C++.
But anyway Java rules for general applications.
Adding an update to Dave Kirby's answer:
Issue 55, Distribute scripts as APKs, in the issue tracker at SL4A deals specifically with that.
There is a solution being worked out (may be complete by now) described at SharingScripts. The only issue seems to be that you need to have a interpreter APK already installed.
you may want to check out Ruboto it is a framework for developing Android apps based on JRuby which means your JRuby code can call Android APIs and can also be called back from the Android Java side.
Here is an introduction article .
Consider ising Kivy, if you want to write Android apps with Python. The process of packing script to .apk file is described here.
The problem is, resulting .apk will be big (~7Mb for 300Kb data). It is obvious, because you need to pack there Python runtime and all libraries.
Another solution I have heard of, is Pygame for Android, but it works on lower lewel, so you need to draw graphics manually.
Unfortunately, I have not tried any of this ways yet, but it looks, that I'm going to start using kivy soon.

Categories