The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
[SOLVED] SDL for Android: package name hard-coded.
wilbefast


Joined: 19 Jul 2011
Posts: 115
Hi all,

I'm nowhere near ready to publish my project, but thinking a bit a head I'm seeing that the hard-coded package name "org.libsdl.app" may be a problem. All apps published on the market and/or installed on a device must have a unique package name to identify them, or they'll over-write each other. Trouble is this package name is hard-coded all over the place, not only in the Java/XML but also in the SDL native glue-code. I'll need to dig out all the references and change them to something else.

Not sure what that something should be though. Obviously I want to give credit to the SDL team for the port, so I was thinking of changing it to "org.libsdl.biotop", even though in theory it should be something like "com.slakgames.biotop" (maybe "com.slakgames.libsdl.biotop"). Not sure what the protocol is in situations like this, because it's the first time I'm working on a commercial product (my Java app on the market is free-ware).

Thoughts?

William
SDL for Android: package name hard-coded.
Forest Hale
Guest

My main observation is that the README.android *really* needs a detailed list of files containing strings to change for each app, folders to rename, etc.

This is not a mere convenience, this is essential to shipping an app.

On 08/05/2011 07:58 PM, William Dyce wrote:
Quote:
Hi all,

I'm nowhere near ready to publish my project, but thinking a bit a head I'm seeing that the hard-coded package name "org.libsdl.app" may be a problem. All apps published on the market and/or installed
on a device must have a unique package name to identify them, or they'll over-write each other. Trouble is this package name is hard-coded all over the place, not only in the Java/XML but also in the
SDL native glue-code. I'll need to dig out all the references and change them to something else.

Not sure what that something should be though. Obviously I want to give credit to the SDL team for the port, so I was thinking of changing it to "org.libsdl.biotop", even though in theory it should be
something like "com.slakgames.biotop" (maybe "com.slakgames.libsdl.biotop"). Not sure what the protocol is in situations like this, because it's the first time I'm working on a commercial product (my
Java app on the market is free-ware).

Thoughts?

William



_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


--
LordHavoc
Author of DarkPlaces Quake1 engine - http://icculus.org/twilight/darkplaces
Co-designer of Nexuiz - http://alientrap.org/nexuiz
"War does not prove who is right, it proves who is left." - Unknown
"Any sufficiently advanced technology is indistinguishable from a rigged demo." - James Klass
"A game is a series of interesting choices." - Sid Meier

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL for Android: package name hard-coded.
wilbefast


Joined: 19 Jul 2011
Posts: 115
When I get round to doing this I'll definately provide a list of files and line numbers - it should be easy enough to merge in. It's certainly essential thing though - you can't really afford to hard-code the unique app identifier :-S

On 6 August 2011 13:34, Forest Hale wrote:
Quote:
My main observation is that the README.android *really* needs a detailed list of files containing strings to change for each app, folders to rename, etc.

This is not a mere convenience, this is essential to shipping an app.


On 08/05/2011 07:58 PM, William Dyce wrote:


Quote:

Hi all,

I'm nowhere near ready to publish my project, but thinking a bit a head I'm seeing that the hard-coded package name "org.libsdl.app" may be a problem. All apps published on the market and/or installed
on a device must have a unique package name to identify them, or they'll over-write each other. Trouble is this package name is hard-coded all over the place, not only in the Java/XML but also in the
SDL native glue-code. I'll need to dig out all the references and change them to something else.

Not sure what that something should be though. Obviously I want to give credit to the SDL team for the port, so I was thinking of changing it to "org.libsdl.biotop", even though in theory it should be
something like "com.slakgames.biotop" (maybe "com.slakgames.libsdl.biotop"). Not sure what the protocol is in situations like this, because it's the first time I'm working on a commercial product (my
Java app on the market is free-ware).

Thoughts?

William





_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


--
LordHavoc
Author of DarkPlaces Quake1 engine - http://icculus.org/twilight/darkplaces
Co-designer of Nexuiz - http://alientrap.org/nexuiz
"War does not prove who is right, it proves who is left." - Unknown
"Any sufficiently advanced technology is indistinguishable from a rigged demo." - James Klass
"A game is a series of interesting choices." - Sid Meier

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Re: SDL for Android: package name hard-coded.
wilbefast


Joined: 19 Jul 2011
Posts: 115
Code:
./jni/SDL/src/main/android/SDL_android_main.cpp:extern "C" void Java_org_libsdl_app_SDLActivity_nativeInit(JNIEnv* env, jclass cls, jobject obj)
./jni/SDL/src/core/android/SDL_android.cpp:extern "C" void Java_org_libsdl_app_SDLActivity_onNativeResize(
./jni/SDL/src/core/android/SDL_android.cpp:extern "C" void Java_org_libsdl_app_SDLActivity_onNativeKeyDown(
./jni/SDL/src/core/android/SDL_android.cpp:extern "C" void Java_org_libsdl_app_SDLActivity_onNativeKeyUp(
./jni/SDL/src/core/android/SDL_android.cpp:extern "C" void Java_org_libsdl_app_SDLActivity_onNativeTouch(
./jni/SDL/src/core/android/SDL_android.cpp:extern "C" void Java_org_libsdl_app_SDLActivity_onNativeAccel(
./jni/SDL/src/core/android/SDL_android.cpp:extern "C" void Java_org_libsdl_app_SDLActivity_nativeQuit(
./jni/SDL/src/core/android/SDL_android.cpp:extern "C" void Java_org_libsdl_app_SDLActivity_nativeRunAudioThread(


I *think* that's all the uses. Mind you, I have no idea how to write generic code for any package name - think it's just a matter of going in a changing everything by hand to suit your app Confused
SDL for Android: package name hard-coded.
Paulo Pinto
Guest

Hi,

to make it generic, one needs to replace the stub names by a mapping structure
and calling RegisterNatives().

http://download.oracle.com/javase/1,5.0/docs/guide/jni/spec/design.html
http://download.oracle.com/javase/1,5.0/docs/guide/jni/spec/functions.html#wp17734

Still the names would need to be hardcoded in some place, so I am not really sure what
you pretend to change.

--
Paulo



On Tue, Nov 8, 2011 at 7:44 AM, wilbefast wrote:
Quote:



Code:

./jni/SDL/src/main/android/SDL_android_main.cpp:extern "C" void Java_org_libsdl_app_SDLActivity_nativeInit(JNIEnv* env, jclass cls, jobject obj)
./jni/SDL/src/core/android/SDL_android.cpp:extern "C" void Java_org_libsdl_app_SDLActivity_onNativeResize(
./jni/SDL/src/core/android/SDL_android.cpp:extern "C" void Java_org_libsdl_app_SDLActivity_onNativeKeyDown(
./jni/SDL/src/core/android/SDL_android.cpp:extern "C" void Java_org_libsdl_app_SDLActivity_onNativeKeyUp(
./jni/SDL/src/core/android/SDL_android.cpp:extern "C" void Java_org_libsdl_app_SDLActivity_onNativeTouch(
./jni/SDL/src/core/android/SDL_android.cpp:extern "C" void Java_org_libsdl_app_SDLActivity_onNativeAccel(
./jni/SDL/src/core/android/SDL_android.cpp:extern "C" void Java_org_libsdl_app_SDLActivity_nativeQuit(
./jni/SDL/src/core/android/SDL_android.cpp:extern "C" void Java_org_libsdl_app_SDLActivity_nativeRunAudioThread(




I *think* that's all the uses. Mind you, I have no idea how to write generic code for any package name - think it's just a matter of going in a changing everything by hand to suit your app [img][/img]


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

gabomdq


Joined: 28 Jul 2011
Posts: 495
Location: Argentina
Hey guys, I've solved this issue for my project. Here's how I did it: http://mdqinc.com/blog/2011/11/using-your-own-app-name-in-a-sdl-android-app/
I hope it's useful for you.

Gabriel.
wilbefast


Joined: 19 Jul 2011
Posts: 115
gabomdq wrote:
Hey guys, I've solved this issue for my project. Here's how I did it: http://mdqinc.com/blog/2011/11/using-your-own-app-name-in-a-sdl-android-app/
I hope it's useful for you.

Gabriel.

Nice one Smile I'm loathe to modify the code directly since it's supposed to be polyvalent. Wrapping it like this is much cleaner. Had to include <jni.h> to get it working though.

Awesome: now the apk is self-contained (thanks to rWops access to assets) and uniquely named, so it's ready to go up on the market. Thanks SDL Very Happy