Skyrape
2012-07-26 00:31:36 UTC
Hi,
*So, When is the NDK going to be on par with the Java SDK ? Is there any on
going progress on the matter ? Is Google working on it ? Is there an
announced release date ?*
*Why do I ask this :*
I'm an Android developer for half a year now and a game developer for quite
a number of years and while at first I liked Android because of the price
accesability, I now prefer iOS for serious development. After months of
Java development although being a C++ developer at the core I can say that
it would've been cool if the NDK was on par with the Java SDK. I personally
have no idea why Java was the preferred language/subsytem and I found
nothing on the internet that actually tells me why google chose this
language.
*How did I find java to be bad :*
So back to the main point, who wants to develop in Java anyway ? You get
only 32MB of RAM unless you use "large heap", an undocumented flag that
supposedly gives me 64MB of RAM, but soon even that will be too little.
Given that I may have a device with 1 GB of RAM I may have at one point a
console-like game requiring 512 MB of RAM. Without going the NDK way, I'm
unable to make my application.
So I'm developing using the NDK and using undocumented functions you don't
find on the main site. At first I thought I didn't read the ndk files
right, but yeah, all those "docs" do not describe any NDK function like say
AAssetManager_open . Next up is random behavior. I develop on NDK and have
to rely on the standard Java SDK for certain features, like say png
decompression ( or at least I tried), so when I do that, if my phone's
screen is off, the android function calls called from my java code fail.
When having a standard java app that doesn't happen. So I dunno what voodoo
magic is going on, but I had to get libpng in my project. I would've
expected they give me the NDK lib for libpng since it's already included in
the Android OS, like they do for libz, but no, the NDK is like a stripped
down version of the original SDK.
One more random behavior that is really annoying is java classes that are
actually C++ constructs behind your back, like the Bitmap class. At any
point in time, since my app is about 5MB (and in a virtual machine it can
occupy far more than that) one of my 20 used bitmaps decides to get
"recycled", so what does that mean ? Well, at the first use my app crashes.
Can I control recycling ? Absolutely not. what happens if I check for
recycling, reload bitmap and then use it ? Well, it may happen that between
reloading and drawing it, it gets recycled again ! WHAT ??? The only fix to
this problem is to go ahead and for every instance in the code where my
bitmap gets called do something like this
synchronized (Drawable.getBitmap())
{
if (Drawable.getBitmap().isRecycled())
{
//Do Reloading
}
Drawable.draw( canvas );
}
That's just annoying. I gave up on that and switched to GL even for a 2D
app. I don't even wanna discuss separate thread canvas drawing and how 2
stacked activities are ok, but at the third one, something really weird
happens (screen goes completely black, but if you power-off screen and
power-on it again, chances are, it's back to normal).
*So what do I want :*
An SDK that installs just like ADT into eclipse or visual studio ( I
actually use vsandroid for NDK development ) and that has all the java SDK
features ( debugging, breakpoints, all java classes) as well so that I can
do whatever I can do now in java, in C++.
*So, When is the NDK going to be on par with the Java SDK ? Is there any on
going progress on the matter ? Is Google working on it ? Is there an
announced release date ?*
*Why do I ask this :*
I'm an Android developer for half a year now and a game developer for quite
a number of years and while at first I liked Android because of the price
accesability, I now prefer iOS for serious development. After months of
Java development although being a C++ developer at the core I can say that
it would've been cool if the NDK was on par with the Java SDK. I personally
have no idea why Java was the preferred language/subsytem and I found
nothing on the internet that actually tells me why google chose this
language.
*How did I find java to be bad :*
So back to the main point, who wants to develop in Java anyway ? You get
only 32MB of RAM unless you use "large heap", an undocumented flag that
supposedly gives me 64MB of RAM, but soon even that will be too little.
Given that I may have a device with 1 GB of RAM I may have at one point a
console-like game requiring 512 MB of RAM. Without going the NDK way, I'm
unable to make my application.
So I'm developing using the NDK and using undocumented functions you don't
find on the main site. At first I thought I didn't read the ndk files
right, but yeah, all those "docs" do not describe any NDK function like say
AAssetManager_open . Next up is random behavior. I develop on NDK and have
to rely on the standard Java SDK for certain features, like say png
decompression ( or at least I tried), so when I do that, if my phone's
screen is off, the android function calls called from my java code fail.
When having a standard java app that doesn't happen. So I dunno what voodoo
magic is going on, but I had to get libpng in my project. I would've
expected they give me the NDK lib for libpng since it's already included in
the Android OS, like they do for libz, but no, the NDK is like a stripped
down version of the original SDK.
One more random behavior that is really annoying is java classes that are
actually C++ constructs behind your back, like the Bitmap class. At any
point in time, since my app is about 5MB (and in a virtual machine it can
occupy far more than that) one of my 20 used bitmaps decides to get
"recycled", so what does that mean ? Well, at the first use my app crashes.
Can I control recycling ? Absolutely not. what happens if I check for
recycling, reload bitmap and then use it ? Well, it may happen that between
reloading and drawing it, it gets recycled again ! WHAT ??? The only fix to
this problem is to go ahead and for every instance in the code where my
bitmap gets called do something like this
synchronized (Drawable.getBitmap())
{
if (Drawable.getBitmap().isRecycled())
{
//Do Reloading
}
Drawable.draw( canvas );
}
That's just annoying. I gave up on that and switched to GL even for a 2D
app. I don't even wanna discuss separate thread canvas drawing and how 2
stacked activities are ok, but at the third one, something really weird
happens (screen goes completely black, but if you power-off screen and
power-on it again, chances are, it's back to normal).
*So what do I want :*
An SDK that installs just like ADT into eclipse or visual studio ( I
actually use vsandroid for NDK development ) and that has all the java SDK
features ( debugging, breakpoints, all java classes) as well so that I can
do whatever I can do now in java, in C++.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/Bt8QbW-MntAJ.
To post to this group, send email to android-***@googlegroups.com.
To unsubscribe from this group, send email to android-ndk+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/Bt8QbW-MntAJ.
To post to this group, send email to android-***@googlegroups.com.
To unsubscribe from this group, send email to android-ndk+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.