perjantai 30. joulukuuta 2011

Leadbolt Appwall example

In this example im going to create a dialogbox that appears when user presses the back-button.
The buttons in the dialog box will be Quit, Cancel and Top Apps. Top Apps will launch Leadbolt Appwall and the others are self explanatory.

Simply Change the Leadbolt url to your Appwall url. I use this on the main menu screen of my apps.

If you are not using Leadbolt at the moment i would suggest that you give it a try. I get 4 times better income than from  Admob or Mobclix. Register as an Leadbolt publisher HERE



Here's the code:

     @Override
    public boolean onKeyDown(int keyCode, KeyEvent event)  {
        if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
            AlertDialog.Builder builder = new AlertDialog.Builder(this);
          //  builder.setTitle("Test");  IF YOU WANT TO SET SEPARATE TITLE
          //  builder.setIcon(R.drawable.ic_launcher); // ICON FOR YOUR ALERTDIALOG
            builder.setCancelable(false); // disable back-button
            builder
                    .setMessage("Do you want to Quit?");
            builder.setPositiveButton("Top Apps",
                    new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int id) {
                        String url = "http://ad.leadboltads.net/show_app_wall?section_id=XXXXX"; //YOUR LEADBOLT APPWALL ADRESS HERE!!
                        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
                            startActivity(intent);
                        }
                    });
            builder.setNeutralButton("Quit", //Quit-button
                    new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int id) {
                        finish();
                        }
                    });
            builder.setNegativeButton("Cancel", //Cancel-button
                    new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int id) {
                            dialog.cancel();
                        }
                    });
            builder.show();
            return true;
        }
        return super.onKeyDown(keyCode, event);
    }


sunnuntai 20. marraskuuta 2011

Push Up



Push-up is program designed to help you improve your upperbody strength and the amount of push-ups you can do. Push up is like a free personal trainer that helps you to get into better shape. Push up has 6 different difficulty levels. User starts from one level and gains strength as he follows the programs routine. When user completes one level he is ready to move to the next one.

Get it from Android Market for free:
https://market.android.com/details?id=org.JR.push_up


Video of the application:

keskiviikko 16. marraskuuta 2011

Interval Timer having problems with soundpool

Im using soundpool to play sounds on the interval timer app i made. I recently got information that the timer does not work properly on cheap android tablets. I tried to change the sound classes to mediaplayer, but it did help.

It is hard to support all devices when the app works fine on emulator and my phone, but it has bugs on some random chinese products. It sucks to get bad rating because the users device does not fuction properly. Well this is one thing in Android that you just have to accept.