Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Kivy and Java for android apps

Tags:

I'm a python developer with little experience creating android apps in java and want to create an app that will access my university web portal, retrieve some data and show on a view.

So, after researching Kivy, I have a few questions:

1) Which one is easier and faster to develop android apps?

2) Does Kivy have any android feature limitations?

3) And finally, would an android app developed using kivy run as fast as one developed using java?

like image 267
Guilherme David da Costa Avatar asked Aug 31 '13 23:08

Guilherme David da Costa


People also ask

Is KIVY good for Android app development?

If you're a Python developer thinking about getting started with mobile development, then the Kivy framework is your best bet. With Kivy, you can develop platform-independent applications that compile for iOS, Android, Windows, MacOS, and Linux.

Which is better KIVY or Android Studio?

To my understanding, the Kivy framework + tools are currently the most favored way for Python developers to create Android based applications, and also to my understanding: Android Studio is the world's most popular Android development platform which spans the option to develop within several different languages ( ...

What is better than KIVY?

Unlike other platforms like Kivy, Flutter provides its own rendering engine to the user, which allows any UI developed to be launched virtually. This rendering engine alone makes it more powerful in comparison to the other frameworks.

Is KIVY better than Java?

The best advantage of using kivy is that it is cross platform and the same project can be used to publish apps on iOS , Android , windows , OS x... However , it has some performance related disadvantages(as do most cross-platform tools like unity , cocos etc). Which language is better for app development?


2 Answers

This is a rather subjective question.

1) Which one its easier and faster to develop android apps?

I think there's a strong argument for kivy, but this doesn't have an objective answer.

2) Does Kivy has limitations to access certain parts of android (like not fully integrated with its api)?

The kivy project includes pyjnius, a tool for accessing java classes through python, and in principle I think this should give arbitrary (edit: on reflection, not arbitrary, but probably not limited in immediately important ways) access to the java apis.

In practice, prebuilt python wrappers are a work in progress, though rapidly improving. The android python library already gives easy access to many things (including but not limited to intents, vibration, accelerometer etc.). Even where there isn't already a python wrapper, it can be very easy to do the necessary work.

Edit: There has recently been great work on Kivy's plyer project, intended to provide a transparent api to platform specific tools so that you can call it once and get the same behaviour on different systems without knowing about the details. It includes useful support for parts of the android api.

3) And finally, an android app developed using kivy would run as fast as one developed using java?

Ultimately the answer is probably no, but the difference is highly unlikely to be important unless you're doing something strongly cpu limited. The task you suggest would not be limited in that way.

like image 145
inclement Avatar answered Sep 19 '22 20:09

inclement


To complete inclement's answer, pyjnius indeed allows to access a lot of the android api. But it's not perfect, calling existing classes is not always enough, and an android programmer often need to create code that will be called by android to manage events, there are two ways to do that, both used by the android api.

  • The first one is interfaces: you need to create a class that implement an existing java interface, pyjnius can do that, you create a python class and declare which java interface it implements, and have a decorator to declare the methods you have to declare.
  • The second is subclassing, you need to subclass an existing java class and override some methods, and we don't have a way to do that with pyjnius yet, so for these ones, you'd have to create a java class and use it in your program (fortunately you can mix that with kivy/pyjnius, it's just can't be 100% python in that scenario).

So it can be worth a look to the api beforehand, to see if the parts of the android api you have to access requires that.

like image 41
Tshirtman Avatar answered Sep 19 '22 20:09

Tshirtman