EvilZone
Programming and Scripting => Java => : Kulverstukas September 13, 2011, 09:54:22 PM
-
I'm a beginner in Java but not a beginner in coding. Started Java at the academy and we should have android app development on third semester or someshit. I can't wait that long and what they are teaching us now I already know :D
So how hard would it be to start making Android/iPhone apps in Java?
Any tips where to begin before I start researching?
-
I don't really know a lot, but will post in this thread because I will be learning how to program Android apps in 2 months or so.
First, you have to get the Android SDK. Install Eclipse, download the SDK, install it, install Eclipse plugin.
Get an Android emulator. You wont want to have to insert your app in a real device each time you want to test it.
And, from what I know, it isn't too different from coding in java. You have an API for interact with Android and so on.
http://developer.android.com/sdk/index.html (http://developer.android.com/sdk/index.html)
-
Only problem you will get to, is to connect the frontend(xml) to backend (java). and the rest is just java:P and some api's
-
You don't need the xml. You can hard code the GUI if you wanted. But it is easier to use xml layout. Getting it into the code is really easy. Just a call to the api to get the GUI object (which will have its own ID), if it's a button or something like that, you need to use a listener method, but other than that, it's all cheddar.
You will need to look into the activity life-cycle, and there are a couple other concepts that are android specific. Like the dalvik virtual machine and setting the Android Manifest file.
-
isn't darvik vm is used to code android app?
-
isn't darvik vm is used to code android app?
Dalvik vm (http://en.wikipedia.org/wiki/Dalvik_(software)) is used. Instead of using a stack based architecture, it uses register based architecture.
On the other hand, you can use Android's NDK which is coded with C/++. Then again, since it uses dalvik, in theory it can execute any vm bytecode. You can find more info here. (http://stackoverflow.com/questions/1994703/which-programming-languages-can-i-use-on-android-dalvik/3323834#3323834)
-
It's about as easy as coding Java. You design the UI elements mostly in a gui / XML combination
-
About the same as Java but of course you are gonna have to learn the android specific functions and how the phone OS works. Here's the guide that got me started: http://www.vogella.de/articles/Android/article.html#overview (http://www.vogella.de/articles/Android/article.html#overview)
It's well explained and gives you some basic apps example. Good way to start.
-
About the same as Java but of course you are gonna have to learn the android specific functions and how the phone OS works. Here's the guide that got me started: http://www.vogella.de/articles/Android/article.html#overview (http://www.vogella.de/articles/Android/article.html#overview)
It's well explained and gives you some basic apps example. Good way to start.
Exactly, which means it isn't even Java, it's an API.
I would say that will be hard in the beginning, specially if you're not used to Java, once you get use to it you need to get use to API, then it's easy :)
Now what I don't know is if the API is made well enough to be able to handle any CPU or Graphic Card and/or driver that might be installed, I've heard from several Java/Android coders that it's not at it's best, personally I've not tried it myself, so I wouldn't know.
If the API isn't well made it means you'll have to make lots and lots of lines just to check the Software and Hardware Versions and the to use the right functions and pass the right parameters.
Good luck on your coding ;)
-
I_Learning_I:
It IS Java just with an API on top. You could write an entire game on it by barely even touching the API, just using Java.
-
I_Learning_I:
It IS Java just with an API on top. You could write an entire game on it by barely even touching the API, just using Java.
http://stackoverflow.com/questions/5371109/why-doesnt-android-platform-run-desktop-apps
This is what I meant.
Also I believe that not all the imports are the same for both Java and Android coding.
Of course that an if() will be recognized, but that's not what I'm not talking about that.
-
Exactly, which means it isn't even Java, it's an API.
I would say that will be hard in the beginning, specially if you're not used to Java, once you get use to it you need to get use to API, then it's easy :)
Now what I don't know is if the API is made well enough to be able to handle any CPU or Graphic Card and/or driver that might be installed, I've heard from several Java/Android coders that it's not at it's best, personally I've not tried it myself, so I wouldn't know.
If the API isn't well made it means you'll have to make lots and lots of lines just to check the Software and Hardware Versions and the to use the right functions and pass the right parameters.
Good luck on your coding ;)
For anything graphic/GPU wise you will be using OpenGL ES. It's just like regular OpenGL, but without the high level abstractions like GLUT you would have on a desktop.
On the other hand, if it is a game you want to make, there are libs out there to help you out. I've been using libgdx for a while now, and it makes things really easy. The good thing about libgdx is, it is regular java. You write two "interfaces", on for desktop the other for the phone. Each is about 10 lines of code. Then you can code the game separate from the platforms and it will work on android and desktop.
You could always code android apps with the NDK instead of the SDK, with the NDK you can skip all the java crap and code directly in C/++.
Here is a video about getting up and running with libgdx:
http://www.youtube.com/watch?v=vLx_72qxK_0 (http://www.youtube.com/watch?v=vLx_72qxK_0)
-
I definitely agree with techb, and what has been said so far.
again here are the important things:
-If you know java, it is easy.
-If you want to create a game use a already development game engine like libgdx or andEngine according on what you want to do, if you want 3d, use unity, except it is kind of expense if I remember right.
-The "hardest" part about android game development is dealing with all the different screen sizes and resolutions of all the android phones out there, that is why using a android game engine is highly recommended.
also, if you can figure it out, I would recommend mybringback tutorials, or the tutorials he did for thenewboston (if you like video tutorials) if you like reading, there are a lot of blog post and open source projects you can easily find what you are looking for.
good luck,
Dwolf
-
we just made an app that contacts a rest service and shows the data and tbh it was fairly easy ;) i don't think you'll have too much trouble.
-
Iphone apps are programmed in objective-c, u need a mac for it u can use something like VMWare and host it on windows/unix but its probably bette to use a mac, anyway objective c isnt the hardest language to learn plus it comes with an ide called Xcode which does the apple design guidelines for you so all the gui is dealt in a storyboard feature, its probably easier than java if im honest and java is a piece off piss to learn so thats saying something!
-
Honestly if I were to code for android I would buckle down and learn C++ and use the NDK. I just feel you could make better applications that way
-
Honestly if I were to code for android I would buckle down and learn C++ and use the NDK. I just feel you could make better applications that way
The developers really discourage that unless it is absolutely needed. But, it still wouldn't hurt to know how.
-
Not so hard, just read the documentation and start fooling around with it ;)
-
The developers really discourage that unless it is absolutely needed. But, it still wouldn't hurt to know how.
Why would they? I guess its just down to NDK vs SDK. But I would think C++ would give me more options then Java, but then again I am unfamiliar with both so what do I know xD
-
Why would they? I guess its just down to NDK vs SDK. But I would think C++ would give me more options then Java, but then again I am unfamiliar with both so what do I know xD
This isn't the whole story, and I can't find the article I read when wondering this myself. This (http://stackoverflow.com/questions/5605575/why-android-used-java-concept-instead-of-d-language-or-c-or-c-but-chromium-we) might help shed a touch of light.
-
Why would they? I guess its just down to NDK vs SDK. But I would think C++ would give me more options then Java, but then again I am unfamiliar with both so what do I know xD
More options.. not so much. The core of the android OS (like basically any OS) is coded in C / C++ because you need more interaction with the material, full control on memory (when and where it's allocate and when you free it) and precise timing for the hardware. Over that first abstraction layer Google decided to use Java for the most part because it's also a solid language, hides most part of that first layer and can run on pretty much any machine that supports the JVM.
Java is mostly mostly underestimated because of its simplicity in my opinion. There's a huge community and most people learn Java as their first language in school so it has a reputation of being an easy language and whatsoever. That's bullshit. The collections are great and way easier to manipulate than the C++ STL and garbage collection is just awesome too if you don't have to deal directly with memory. I might be a bit sold because I currently work for a company that uses mainly Java but as a high level software engineer I often prefer C# and Java over C++ because why re-invent the wheel and care about stuff you shouldn't when you don't have to.
Disclaimer: In no way am I saying C++ is not a good language. It's a superior language in many situations but just don't underestimate Java and why Google used it for Android.