• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Game Development questions

seth3000

Lurker
I have a few questions that I have about making an app for an android written in JS. I would like to know if it's necessary to learn CSS and XML. Also what other programming languages do you recommend that I learn to help me develop games and apps in JS.
 
1) Android apps are written in Java, not JS. The only thing they have in common is 4 letters. They're totally different languages.

2) Android isn't a web page, so it doesn't use CSS, You can use xml in parts.

3) I suggest that you forget about writing games and apps in JS, because they would only run in a web browser, not in an Android phone. Learn Java.
 
theoretically you can develop games with JS in Unity and there no need for css. But as already posted android applications are written in Java.
 
I was just looking for a little guidance. Thanks for letting me know that I need to be writing in Java. Where can I learn Java? and how would I go about placing in 3d and 2d animations? Is that written in Java as well?
 
You can pretty much learn java from the internet. Meaning doing a bunch of research and reading for the beginning part to learn the basics of Java.(There are a few books that Ive used and can recommend) Then you follow a bunch of tutorials that may or may not be related to what you are actually trying to do. Repeat those steps alot! Repeat some more, until you have a solid idea of java and can make app/games that you want!

Java/Android can handle animations. Otherwise you could always go with a game engine that supports Android and use that.
 
You can pretty much learn java from the internet. Meaning doing a bunch of research and reading for the beginning part to learn the basics of Java.(There are a few books that Ive used and can recommend) Then you follow a bunch of tutorials that may or may not be related to what you are actually trying to do. Repeat those steps alot! Repeat some more, until you have a solid idea of java and can make app/games that you want!

Java/Android can handle animations. Otherwise you could always go with a game engine that supports Android and use that.

What are some books that you recommend?
 
beginning programming with java for dummies 3rd edition
beginning android 4 games development
android game programming for dummies

These are the ones ive used. The dummies editions have downloads on their website where you can download all the code examples used in the book and follow along. just beware that some code in the examples can be different from the book and vice versa.

There are tons of different books out there for android.
 
If I choose Java, then if I want to create the same app for iOS, I need to rewrite everything in Objective-C? No way, it's just a waste of time. As for me, I prefer to write my app once in Haxe/OpenFL, then compile it to Android and iOS, Flash, Windows, Linux and Mac without any problem - I just select any target and hit "Compile". OpenFL compiles to C++ code and uses Android NDK, which makes app much faster than HTML5-based app.
 
If I choose Java, then if I want to create the same app for iOS, I need to rewrite everything in Objective-C? No way, it's just a waste of time. As for me, I prefer to write my app once in Haxe/OpenFL, then compile it to Android and iOS, Flash, Windows, Linux and Mac without any problem - I just select any target and hit "Compile". OpenFL compiles to C++ code and uses Android NDK, which makes app much faster than HTML5-based app.

Very true; however, with a lot of these cross platform tools you have have more restrictions on how it runs across different devices. This is fine for iOS since all versions use basically the same code and same dpi displays, but with android there are so many devices and android versions that it is harder to fine tune your game with a muti-platform compiler then with plain java. But yes it is annoying to rewrite code, but i usually change things from Android to iOS. Also writing in objective c and java for the respected devices will yield the best performance; primarily in android as java assembly is different then c++ and C assembly.

Edit: raw 3d code is going to be very difficult if your new to java (or any language for that matter) openGL and openGL engines are favored for that but its still difficult natively coding that. Just a heads up.
 
Very true; however, with a lot of these cross platform tools you have have more restrictions on how it runs across different devices. This is fine for iOS since all versions use basically the same code and same dpi displays, but with android there are so many devices and android versions that it is harder to fine tune your game with a muti-platform compiler then with plain java.
Maybe you are right in a sense, but this particular tool (I mean OpenFL) has an advantage: you can create your own "extensions" in a native language (for example, in Java for Android) and call Java functions or methods from OpenFL. You also have #defines, that allow you write conditional code, like so:
Code:
#if android
// do some android stuff
#else is ios
// say hello to ipad
#end
It really gives you a true freedom to do everything you like.
 
Maybe you are right in a sense, but this particular tool (I mean OpenFL) has an advantage: you can create your own "extensions" in a native language (for example, in Java for Android) and call Java functions or methods from OpenFL. You also have #defines, that allow you write conditional code, like so:
Code:
#if android
// do some android stuff
#else is ios
// say hello to ipad
#end
It really gives you a true freedom to do everything you like.


So do these #defines include writing in native code?

like #if android
//java code
if ios
//obj c code

or is that only for the conditional code? which i would assume includes OS checks?
 
Not exactly. You can write a native code separately and call it from OpenFL, for example:

Code:
//Some.java for android native functionality
class Some{
   static int getSum(int a, int b){
      return a+b;
   }
}
Code:
//Some.cpp for iOS native functionality
static int Some::getSum(int a, int b){
   return a+b;
}

and in Haxe:
Code:
...
#if android
/// calling Some.getSum func using JNI functionality of OpenFL
#else if ios
/// calling Some.getSum using C++ bridge facilities
#end
...
Of course it's not exact way to do this and usually you don't need to do this, since we have plenty of extensions already written by community.
 
That must be incredibly high level code in order to do that. The higher level code the less proficient the code is. That would be like Adobe coding their photoshop in Visual Basic.
 
Not at all, the code is compiled to C++ and it runs very fast. I don't see any reason why would you compare C++ to VisualBasic and say that C++ is "incredibly high level code".
 
My apologies, I thought it was a scripting language that then compiled to each individual language. Not to C++. Your right.
 
Accepted :) Besides, the modern era of scripting languages is something different from what it was a decade ago: Google V8 can run JavaScript only 1.5-3 times slower than similar C++ code.
 
Yea, No longer are the days when you have to use assembly to be able to make the most out of processors and their registers.
 
Even today you will get the most out of your processor by using assemby, but who needs "the most"? Just add another 4 cores to your CPU and relax! :)
 
Back
Top Bottom