Android black screen

Hi,
I am porting iPhone game to Android.My Apk is more then 50 MB so i have integrated the
Apk expansion code,but when i download file and extract in SD card ,then it will pass intent to game activity,
only first time my scene get the blank screen(with sound) but i restart the app next time then it works fine.

First screen images are in only in assets.
I have also implement the weak lock in app.

Thank you,
Sameer

Hi Sameer

It happens sometimes. Do you facing it every time you start the app or just immediately after downloading expansion file?

Hi,
just immediately after downloading expansion file, let me if have any solution for it.
If it open directly then it never happen, or put the expansion file in directly in SD card.

Thank you,
Sameer

Hmm…

How are notifying the CPP code from JAVA that extension file is downloaded and now it can take control? Can you paste the snippet of the that code? Looks like problem in sending notification.

Hi,
In apk-expansion smaple code there is function validateXAPKZipFiles which is Asyn Task to unzip the files,
in post excute
protected void onPostExecute(Boolean result) {
if (result) {
mDashboard.setVisibility(View.VISIBLE);
mCellMessage.setVisibility(View.GONE);
mStatusText.setText(R.string.text_validation_complete);
mPauseButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// to go game activity
GotoGame();
}
});
mPauseButton.setText(android.R.string.ok);
// to go game activity
GotoGame();

In ndk stack this show error,
signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 5db0ed30
Stack frame #00 pc 00021d30 : Unable to open symbol file D:games_engine\coco2dx\cocos2d-2.0-x-2.0.4\DragonboatLite\proj.android/obj/local/a
rmeabi//. Error (123): Unknown error
Stack frame #01 pc 00119381 /data/data/com.Connected101.DragonBoatRacingLite/l
ib/libgame.so (SplashScreenScene::scene()+36): Routine scene in jni/…/…/Classe
s/SplashScreenScene.cpp:20
Stack frame #02 pc 000e9e29 /data/data/com.Connected101.DragonBoatRacingLite/l
ib/libgame.so (AppDelegate::applicationDidFinishLaunching()+372): Routine applic
ationDidFinishLaunching in jni/…/…/Classes/AppDelegate.cpp:80
Stack frame #03 pc 0017c383 /data/data/com.Connected101.DragonBoatRacingLite/l
ib/libgame.so (cocos2d::CCApplication::run()+18): Routine run in D:/Projects/gam
es_engine/coco2dx/cocos2d-2.0-x-2.0.4/DragonboatLite/proj.android/…/…/cocos2dx
/platform/android/CCApplication.cpp:33

in splash screen line 20 scene->addChild(layer);

it happens only first time when i download the file from google code.

Thank you,
Sameer

IMO, you are not notifying the CPP code in a right fashion.

It should be like this…

You game should show the progress bar on OpenGL layer whereas expansion file should be downloaded at background.
You can pass the message between Java and CPP via JNI.

To notify the OpenGL layer, make sure that you use eventqueue method otherwise it will be jerky and application may crash.

Hi,
I got the issue,
it was due to Asyn taks called two time one after another,activity gets finish but task was running,

onDownloadStateChanged
case IDownloaderClient.STATE_COMPLETED:
showDashboard = false;
paused = false;
indeterminate = false;

if(isAsynTaskRunning==false){
Log.d(“SWITCH1”, “validateXAPKZipFiles”);
validateXAPKZipFiles();
}
return;

Thank all developer for helping me.

Sameer z wrote:

Hi,
I got the issue,
it was due to Asyn taks called two time one after another,activity gets finish but task was running,
wish this Apk expansion could merge into cocos2d-x as a extension.

someone could do this???

>

onDownloadStateChanged
case IDownloaderClient.STATE_COMPLETED:
showDashboard = false;
paused = false;
indeterminate = false;
>
if(isAsynTaskRunning==false){
Log.d(“SWITCH1”, “validateXAPKZipFiles”);
validateXAPKZipFiles();
}
return;
>
Thank all developer for helping me.

Hi,
Actually it is great idea,but i am Android developer and as i was porting the game iPhone to Android,so
did not have much knowledge about the C++, but i can share the code what i done for apk expansion.

Thank you,
Sameer

Hi Sameer, can you please share you code for android expansion?