Jump to content

  • Log In with Google      Sign In   
  • Create Account

How to use Java application on Android


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 Patriarch K   Members   -  Reputation: 212

Like
0Likes
Like

Posted 02 November 2012 - 08:40 AM

This is something that I'm wondering about at the moment and I know that it's pretty much a beginners question, but do I have to do something with the code? How am I supposed to do? I want for example my application to be able for downloading on the internet on my own home page. Am I supposed to have a .jar-file to do this or something?
In short - how can I use my Java app on my Android phone.
Any advice?

Sponsor:

#2 frob   Moderators   -  Reputation: 22732

Like
1Likes
Like

Posted 02 November 2012 - 10:03 AM

The app needs to be built targeting the platform.

There is a tutorial here with links to instructions on building your first app, and also with links to the tools you will need.

Check out my book, Game Development with Unity, aimed at beginners who want to build fun games fast.

Also check out my personal website at bryanwagstaff.com, where I write about assorted stuff.


#3 6677   Members   -  Reputation: 1058

Like
1Likes
Like

Posted 02 November 2012 - 03:49 PM

android does not run java. It runs dalvik. For all intents and purposes dalvik is basically java (source code is the same etc) but they aren't compatible. Dalvik also compiles to a .apk not a .jar. Dalvik bytecode is altered from standard java bytecode in order to be more efficient on mobile devices, there were some pretty fundamental changes though so java bytecode will not run on a dalvik VM or vice versa.

Most handsets if you just stick a .apk on the SD card or internal memory somewhere (downloaded from dropbox, mediafire, wherever) and then find it in the file browser will install the .apk to the device and add it to the app screens as normal. Some cell operators distribute handsets with branded firmware which may disable this functionality however that is very rare (I have come across one HTC handset on the vodaphone network with it removed).

So really if you want to bypass the play store entirely you would compile your application to a single .apk file. Stick it on a file sharing service. Users would find it in browser, it would be downloaded into their downloads folder on their SD card. When they tap it on the SD card it will prompt for install, they click yes, it installs it, done.

Most people just use the google play store as 99% of users rarely venture outside of it to obtain their apps.

#4 Patriarch K   Members   -  Reputation: 212

Like
0Likes
Like

Posted 02 November 2012 - 05:08 PM

Soo...I don't really need to follow the tutorial that frob linked me to - I can instead use my finished code piece and compile it with something else in short? :)

#5 SimonForsman   Crossbones+   -  Reputation: 6306

Like
0Likes
Like

Posted 02 November 2012 - 05:18 PM

Soo...I don't really need to follow the tutorial that frob linked me to - I can instead use my finished code piece and compile it with something else in short? Posted Image


The application model is quite different as well, Android apps are not written in the same way as normal Java apps.
I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

#6 6677   Members   -  Reputation: 1058

Like
0Likes
Like

Posted 06 November 2012 - 04:07 PM

Well your existing java application will use libraries not available on android. You can't just change a compile setting. A full port will need doing although a fair amount of program logic will be re-usable.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS