• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Anyone familiar with creating apps for android or cross platform?

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
To a large degree writing Android applications is similar to writing Java programs except instead of using the Java standard library framework you must use ones written by Google which either fulfil special purposes (phone calls, SMS, micro transactions etc) or are simplified versions of the standard library. Additionally Android does not have a Java virtual machine, instead pre-compiling it into Dalvik instructions for the Dalvik virtual machine (as such the language does not operate like Java).

One of the largest differences is in the scheduler model used. With Java processes the threads compete equally with all other threads running on a system for CPU time based on the thread priority and scheduler used. In Android any process that is not the currently active process (not currently in focus/subject of display) has all its threads automatically forced into a low priority state (background) until focus is restored to the process. Additionally the scheduler uses a grouping policy meaning that the background group can become highly starved with limited guarantees being made on the amount of time the threads will receive (they will get some time, eventually). As such you must mostly design processes to run when focused, and design them such that if they lose focus for extended periods they compensate for that time.

Additionally Android application design (their equivalent of processes) is "activity" based rather than the traditional "main" entry based. When an application is started a specific activity is initialized. An application can have many activities in it. When an activity is changed it either enters a suspended state (overlay with another activity), is stopped (change of application) or destroyed (change of activity) and a new activity is created. Since this means that there is no direct consistency between activities, one has to manage background tasks and data sharing separately. This more mirrors inter-process communication on a standard operating system than intra-process communication which one is normally used to.

Additionally usually trivial tasks such as file I/O are made excessively complicated due to the Google interfaces involved and them targeting people with no computer understanding. Although it does use a file based system due to the Linux kernel, the user and developers are largely abstracted away from this with strange automatic file allocation practices for application data storage. The whole host of temporary, cache and long term files one is used to creating become a real pain to make and so should be used sparingly.

Activities are also aimed at multi-platform design. As such a lot of meta-data is required to cope with displays of various sizes. This ranges from different resolution assets to completely different activity layout files.

There is also a whole host of "security" stuff you need to get angry with. Normally trivial tasks might throw security exceptions (especially anything outside of an activity, such as I/O). Each has to be allowed with the activity specific security settings, an XML metadata file.

Let us not forget the backwards compatibility problem. Many possibly useful features might only have been added in later Android versions than what you are targeting.

Also it uses different standard OpenGL implementation called OpenGL ES (OpenGL Embedded System) for graphic acceleration. This is very different from normal OpenGL as most of the features you would take for granted when producing OpenGL processes are missing or greatly restricted. This is a major bane for developers porting from desktops an consoles to Android as it usually means they have to write and entirely new graphic component for their application.

After you download Eclipse and the Android SDK you should probably follow the Google tutorials on developing basic apps. They come with examples and give you some ideas as to what to do. However if you are like me you will still be confused after it all.

Do be aware that Android has a specific style, people will probably flame you if you violate their styling rules (eg, make an app look like a IPhone app rather than an Android app, even though it is possible to do so).
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
With the Android SDK, you mean the Android Studio?

At school we downloaded the original SDK which did gave us the option to make the game we made also for android... however, I switched to Netbeans and removed eclipse from my pc.
And right now, the links to the android SDK are changed to the Android Studio.

However, at this point I am just trying to get buttons work, open screens, create text fields and show images... stuff like that.
But even though I developed JAVA and C# mostly... only, I still dont know anything because it is not Swing that is used.
Instead, as you said, they use stuff from Google.

Also I do have problems installing the apps on my mobile device.
Stuff with regular .apk installer.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
You can launch your application directly from Android Studio, either using an emulator, or your phone. You just have to be sure it's set to debug mode (which it should be by default), since that signs it with a debug key.
Or you can build it and manually send the APK and install it, which requires you to turn on "Unknown Sources" on your phone (as it would gladly tell you).

As to developing for Android in general - welcome to lots of XML + automatically generated hard coded strings + terrible APIs + Java syntax. In other words, the worst.

And that's before even starting about actually interacting with Google in any way (leaderboards, purchases, not being able to test your own product and instead forcing you to invite other people on Google+ because that's logical, and lots of other really great user friendly practices).

As to Moai - it's pretty mature and you write code in Lua. It's not very easy to start with, unlike some other popular Lua-based frameworks (e.g. Corona), but it lets you do advanced stuff when you need to, and its completely free. You'll still end up wasting your time on Google related things such as the ones highlighted above, but nothing to do about that...
And of course, it's open source and cross-platform, so that's always a bonus (you'd probably want to publish to iOS at some point?)
The drawback is that you don't have direct control over the Java-side, unless you edit the Java side. That is, if for example you want UI elements, you need to make them by yourself, and can't depend on the native ones, unless you go and make them in Java like you'd usually do (this isn't true for some things like native confirmation dialogs, which Moai does support).
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
At school we downloaded the original SDK which did gave us the option to make the game we made also for android... however, I switched to Netbeans and removed eclipse from my pc.
And right now, the links to the android SDK are changed to the Android Studio.
I studided this last year. I am sorry but that was a long time ago apparently.

Google could have changed how they distribute the SDK now to something like a studio. Microsoft did the same a while ago when it removed the DirectX and Windows SDKs and merged them into the Visual Studio distribution (they come with it as opposed to separate installs).

However, at this point I am just trying to get buttons work, open screens, create text fields and show images... stuff like that.
But even though I developed JAVA and C# mostly... only, I still dont know anything because it is not Swing that is used.
Instead, as you said, they use stuff from Google.
I will have to tell you what my lecturers told me. Read the tutorials. Google wants people to make apps for their system so they have written pretty extensive documentation on how to create activities, add views to them, include buttons and their handlers etc. They should still be relevant unless they migrated away from Java development. Mind you, after you read them you will still be quite confused as what to do.

As to developing for Android in general - welcome to lots of XML + automatically generated hard coded strings + terrible APIs + Java syntax. In other words, the worst.
I still have nightmares from it.
 
Level 2
Joined
May 17, 2015
Messages
10
Hello!

I've been working in the android development department of a company for some months and all I have to say is, for a smartphone OS, programming multimedia in it sure sucks.

I've used mostly Android Studio and Eclipse but the native support for multimedia is just awful.

I.e. not being able to directly play a gif file, videoviews are buggy inside scrollviews, etc.


I might be biased since I haven't programmed much for other smarthphone OS, and no multimedia for other than android at all. But meh, I was expecting much more.
 
Status
Not open for further replies.
Top