Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - azid

#1
Controls: Single touch anywhere on screen to move forward. Double simultaneous touch anywhere on screen to turn left. Triple simultaneous touch  anywhere on screen to turn right. Untouch to continue moving.

Audio still playing after app stop: Audio should stop too when I press back or home button to stop the app. Will do more test on this.

Blue band: Will get either an S3 or note before making any changes.
#2
Hajj3D for Android Alpha Trial ready for download. Feel free to test the app and please give us your feedback.

The app was tested on Samsung Galaxy S3. Runs OK. Crowd runs too fast though. There's also blue bands on certain objects such as floors. The pic shows the blue bands. It seems that that's where mipmapping occurs. No blue bands on Galaxy Tab, Galaxy S or Experia Arc though.


[attachment deleted by admin]
#3
I am getting this message on logcat:

01-09 15:41:34.946: I/Choreographer(403): Skipped 277 frames!  The application may be doing too much work on its main thread.

Should I be worried? Should I separate certain tasks on different thread? like collision, for example?

Its running very slow on emulator (0.5 - 2 fps) but relatively ok on Galaxy Tab P1000 at 9-51 fps depending on how many objects seen.

p.s. Thank you so much for all the help so far. I'm still learning jPCT-AE and and am lovin it.
#4
Projects / Re: Aaagh!
December 25, 2012, 11:16:51 AM
Wow! this is good. Thanks!.
#5
Just figured it out!. The background sound won't  play if mediaplayer is set in onStop, onResume and onPause. The only code required is in onDestroy (stop the sound when app is killed). The standalones all set it in all ons coz most have buttons to play and pause. Very simple code too, just a few lines for background sound to play continuously.

For mp3 format, i'm more familiar with mp3 than ogg and I can fine tune the audio such as resample it to VBR to reduce size without losing too much quality. The mp3 was 1.4mb, ogg was 1.5mb but resampled mp3 is now 710kb for a 92sec of audio (minimal loss). Besides, i may test the java code with j2objc soon and i heard that ios don't do ogg.

Btw, lets look at the code:


..
import android.media.MediaPlayer;   // 1st line needed
..
public class Your3Dapp extends Activity {   
..
MediaPlayer mediaPlayer;     //  2nd line
int soundID = 1;                    //  optional
..
protected void onCreate(Bundle savedInstanceState) {
--
         mediaPlayer = MediaPlayer.create(this, R.raw.the_sound);   //  3rd line

mediaPlayer.start();                  //  4th line
      mediaPlayer.setLooping(true);    //  optional
      mediaPlayer.setVolume(100,100);   //  optional
..
protected void onPause() {      //  leave this alone
Logger.log("onPause");
super.onPause();
mGLView.onPause();
}

@Override
protected void onResume() {
Logger.log("onResume");
super.onResume();
mGLView.onResume();
}

protected void onStop() {              //  leave this alone
Logger.log("onStop");
super.onStop();
}

protected void onDestroy() {
if(mediaPlayer != null)      //  5th line needed
{
try{
mediaPlayer.stop();        //  6th line
mediaPlayer.release();    //  7th line
}finally {
mediaPlayer = null;   //  8th line
}
super.onDestroy();
}
}
..
#6
This is more difficult than I imagine. For 3 days I tried to play background music (a 1.4mb Mp3) upon startup of the app but it either hang or crash. About a dozen ways were used. Funny thing is, if the app is just for playing sound it runs ok. When used with 3d it crashed. Used mediaplayer, soundpool as well as propriety libraries. Maybe the 3d and sound together caused out of memory error?. The following were tried:

Crash with 3d, standalone sound plays ok.
1.  Paulscode's Android to play ogg file (with jni, c++, etc, file was converted to 1.5mb ogg)
2.  http://androidatteja.blogspot.com/2009/04/android-mediaplayer-example.html
3.  http://www.badprog.com/android-mediaplayer-example-of-playing-sounds
4.  http://stackoverflow.com/questions/9108642/androidplay-audio-files-using-single-mediaplayer-object-and-also-display-images?rq=1
5.  http://lab-programming.blogspot.com/2012/01/how-to-work-around-android-mediaplayer.html
6.  http://developer.android.com/training/managing-audio/volume-playback.html
7.  etc etc

Help please. Should 3d and sound be separated by its own thread? How to do it? How to estimate memory usage? Is the sound linked to hardware volume keys?
#7
Hi,

I am developing something big  ::)  using jPCT-AE. Please visit

http://www.vhearttech.com

Feel free to leave comments. Latest updates are in the blog.

Azid