Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Turning java game into Android game
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Unknown25




PostPosted: Fri Dec 21, 2012 11:04 pm   Post subject: Turning java game into Android game

Hi,

I am trying to turn my Java game of Connect Four into an Android game but I am not sure what to do. The online guides don't really help much because I use "Ready to Program Java IDE".

The game requires 2 .java files and 2 .png files to work.

Does anything need to be changed before making it .apk file? What do I have to do to make it a .apk file?
The game can be played using the mouse or arrow keys.

Thanks a lot!
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: Sat Dec 22, 2012 10:39 pm   Post subject: RE:Turning java game into Android game

You shouldn't use Ready to Program. It uses an ancient version of Java with custom libraries that won't work outside of RTP. You need to download the Android development kit, and probably re-write your game from the ground up.

Remember- most cell phones haven't got a mouse or arrow keys (and the ones that do aren't really great for gaming). You'll want to implement a touch-screen interface.

This is not going to be an easy task. It will take a lot of work. If you're serious about this, you should probably write some very basic Android applications first to get used to the platform.
tyuo9980




PostPosted: Mon Dec 24, 2012 4:12 pm   Post subject: Re: Turning java game into Android game

There is a bit of a learning curve when it comes to porting a game over to Android.

You will have to download the android sdk and manager.
You should be using Eclipse to compile and build the apk. You will also be able to test your game on the android emulator in eclipse.

- Mouse states will have to be converted into touch states
- The main game loop structure will have to be rewritten
- Responses for a change in app state will have to be coded
- If you have multiple pages/screens in your game, you can choose to draw it graphically like in java, or create a XML layout that uses android's own buttons, scroll panes, etc.
- Saving game preferences, scores, and writing to files will have to be recoded. Take a look at SharedPreferences.
- Although you should be doing this anyways, make sure that your code is as efficient as you can get it. There isn't nearly as much processing power on a phone.
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: