Android API Amusements

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
User avatar
Trask
ES Beta Backer
ES Beta Backer
Posts: 738
Joined: Wed Oct 29, 2008 8:17 pm
Current Project: Building a 2D Engine
Favorite Gaming Platforms: Sega Genesis and Xbox 360
Programming Language of Choice: C/C++
Location: Pittsburgh, PA
Contact:

Android API Amusements

Post by Trask »

Two things brought to my attention today in the Android API: http://developer.android.com/reference/ ... nager.html
float GRAVITY_DEATH_STAR_I
float GRAVITY_EARTH
float GRAVITY_JUPITER
float GRAVITY_MARS
float GRAVITY_MERCURY
float GRAVITY_MOON
float GRAVITY_NEPTUNE
float GRAVITY_PLUTO
float GRAVITY_SATURN
float GRAVITY_SUN values returned by the accelerometer in various locations in the universe.
float GRAVITY_THE_ISLAND
and http://developer.android.com/reference/ ... nkey%28%29
public static boolean isUserAMonkey ()
Since: API Level 8

Returns "true" if the user interface is currently being messed with by a monkey.
That silliness being said and done, anyone mess around with any Droid development?
MarauderIIC wrote:You know those people that are like "CHECK IT OUT I just made Linux run on this piece of celery [or other random object]!!"? Yeah, that's Falco, but with ES.
Dear god, they actually ported ES to a piece of celery!
Martin Golding wrote: "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."
User avatar
epicasian
Chaos Rift Junior
Chaos Rift Junior
Posts: 232
Joined: Mon Feb 22, 2010 10:32 pm
Current Project: Gigazilla Engine
Favorite Gaming Platforms: Dreamcast, SNES, PS2, PC
Programming Language of Choice: C/++
Location: WoFo, KY

Re: Android API Amusements

Post by epicasian »

I've actually been looking into the Android NDK: http://developer.android.com/sdk/ndk/index.html

Now only if the iOS devices had some C/++ headers...
User avatar
avansc
Respected Programmer
Respected Programmer
Posts: 1708
Joined: Sun Nov 02, 2008 6:29 pm

Re: Android API Amusements

Post by avansc »

I looked at the """"""""NDK""""""""" thinking it might be complete NATIVE C code, and its not, it just uses java's long existing JNI, now while you do write in straight C++, or for that matter, you can wrap almost any language in it. you PRE compile the code, now this is fine for something as specific as say phone X... but in most cases this code become non portable, breaking on of javas main features.

Anyways, the iOS is fine as it is, and you CAN use C/++ headers in it, whatever you meant by that.
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
User avatar
MrDeathNote
ES Beta Backer
ES Beta Backer
Posts: 594
Joined: Sun Oct 11, 2009 9:57 am
Current Project: cocos2d-x project
Favorite Gaming Platforms: SNES, Sega Megadrive, XBox 360
Programming Language of Choice: C/++
Location: Belfast, Ireland
Contact:

Re: Android API Amusements

Post by MrDeathNote »

hotxxl007 wrote:Titleist 2010 AP2 Irons for Sun and Wind

Golfers spend a lot of time outdoors with titleist 2010 ap2 irons. Special attention is therefore needed to protect their eyes from an extended exposure to the sun and the wind. Wind and the dirt and debris carried by it may cause irritation of the eye. What is worse is the prolonged exposure to the ultraviolet rays of the sun for your titleist 2010 ap2. ishiner
WTF!!!
http://www.youtube.com/user/MrDeathNote1988

Image
Image

"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup
User avatar
Milch
Chaos Rift Junior
Chaos Rift Junior
Posts: 241
Joined: Sat Jul 11, 2009 5:55 am
Programming Language of Choice: C++
Location: Austria, Vienna

Re: Android API Amusements

Post by Milch »

I'm currently developing a game for Android and I've never seen these functions before :D
As far as I know, you don't need the NDK that much. It is core-dependent, so you would have to compile it for each core on the market.
Actually, you should only use the NDK for "hardcore" calculations, like physics stuff.
Follow me on twitter!
User avatar
epicasian
Chaos Rift Junior
Chaos Rift Junior
Posts: 232
Joined: Mon Feb 22, 2010 10:32 pm
Current Project: Gigazilla Engine
Favorite Gaming Platforms: Dreamcast, SNES, PS2, PC
Programming Language of Choice: C/++
Location: WoFo, KY

Re: Android API Amusements

Post by epicasian »

avansc wrote:I looked at the """"""""NDK""""""""" thinking it might be complete NATIVE C code, and its not, it just uses java's long existing JNI, now while you do write in straight C++, or for that matter, you can wrap almost any language in it. you PRE compile the code, now this is fine for something as specific as say phone X... but in most cases this code become non portable, breaking on of javas main features.

Anyways, the iOS is fine as it is, and you CAN use C/++ headers in it, whatever you meant by that.
Yeah...I thought the NDK was a "Get out of Java free card" sadly, it isn't.
User avatar
aamesxdavid
ES Beta Backer
ES Beta Backer
Posts: 347
Joined: Wed Jan 07, 2009 8:49 pm
Location: Bellevue, WA
Contact:

Re: Android API Amusements

Post by aamesxdavid »

I've made a soundboard so far, and am trying to get the save-as-ringtone functionality. I'm not too crazy about Eclipse, but overall, it's been fun developing so far.
User avatar
Milch
Chaos Rift Junior
Chaos Rift Junior
Posts: 241
Joined: Sat Jul 11, 2009 5:55 am
Programming Language of Choice: C++
Location: Austria, Vienna

Re: Android API Amusements

Post by Milch »

aamesxdavid wrote:I've made a soundboard so far, and am trying to get the save-as-ringtone functionality. I'm not too crazy about Eclipse, but overall, it's been fun developing so far.
Yeah, in my oppinion Eclipse sucks.
I simply hate the idea of having workspaces and in these workspaces there are projects.
I accidentally deleted some of my projects trying to close them, until I realized that all projects inside a workspace are shown up and I need to switch workspace.
Follow me on twitter!
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: Android API Amusements

Post by dandymcgee »

Milch wrote:
aamesxdavid wrote:I've made a soundboard so far, and am trying to get the save-as-ringtone functionality. I'm not too crazy about Eclipse, but overall, it's been fun developing so far.
Yeah, in my oppinion Eclipse sucks.
I simply hate the idea of having workspaces and in these workspaces there are projects.
I accidentally deleted some of my projects trying to close them, until I realized that all projects inside a workspace are shown up and I need to switch workspace.
Sounds just like Visual Studio's solutions. I'm not sure why you would want multiple projects connected together like that.. but I guess it might be useful to some? I wouldn't say Eclipse sucks because of it though, that's a pretty drastic conclusion for a silly mistake.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
aamesxdavid
ES Beta Backer
ES Beta Backer
Posts: 347
Joined: Wed Jan 07, 2009 8:49 pm
Location: Bellevue, WA
Contact:

Re: Android API Amusements

Post by aamesxdavid »

dandymcgee wrote:Sounds just like Visual Studio's solutions. I'm not sure why you would want multiple projects connected together like that.. but I guess it might be useful to some? I wouldn't say Eclipse sucks because of it though, that's a pretty drastic conclusion for a silly mistake.
It's not as if the idea that projects are connected by workspaces is the only issue. Probably the real issue with that is how poorly it's communicated. Your default workspace is automatically generated for you, and any projects you make will be automatically inserted into that workspace. So you really have no idea what's going on unless you stumble around the menus looking for a way to clear all of your projects from the interface (but still keep them saved).

The other issue with it is that you don't have project files. This annoys me to no end. There are just a bunch of folders within your workspace folder. So you can't just load a project, you have to load the workspace from within the IDE, and then load the project from the sidebar. It's horrifically unintuitive, and doesn't really allow you any control over how you manage your projects. I'm guessing it's a condescending pat on the head to Java developers - "Oh, you poor little thing, you can't possibly manage all these projects yourself; allow me." I can't imagine anyone using it for C++, unless that's how they happen to prefer managing their projects anyway.

/rant
User avatar
MrDeathNote
ES Beta Backer
ES Beta Backer
Posts: 594
Joined: Sun Oct 11, 2009 9:57 am
Current Project: cocos2d-x project
Favorite Gaming Platforms: SNES, Sega Megadrive, XBox 360
Programming Language of Choice: C/++
Location: Belfast, Ireland
Contact:

Re: Android API Amusements

Post by MrDeathNote »

Milch wrote:
aamesxdavid wrote:I've made a soundboard so far, and am trying to get the save-as-ringtone functionality. I'm not too crazy about Eclipse, but overall, it's been fun developing so far.
Yeah, in my oppinion Eclipse sucks.
I simply hate the idea of having workspaces and in these workspaces there are projects.
I accidentally deleted some of my projects trying to close them, until I realized that all projects inside a workspace are shown up and I need to switch workspace.
What!! Eclipse has some of the best refactoring tools about (for java anyway). I use it for C++ on linux, it may not have all the fancy features the java version has but it's still pretty damn nice.
http://www.youtube.com/user/MrDeathNote1988

Image
Image

"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup
Post Reply