AdMob Success!

Admob has been running for two days now! It’s really interesting to see the amount of people who will open the help/donate activity and scroll to the bottom and actually click the ad. I’m surprised to see that almost 300 people in two days have looked at the banners, So far I’ve generated $0.06!

AdMod

I’ve decided to add two ads to the DBZ app. It wasn’t working until I manually added the .jar to the lib folder.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


<com.google.ads.AdView
 android:id="@+id/ad"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
 android:layout_gravity="center"
 android:layout_marginBottom="5dp"
 android:layout_marginTop="20dp"
 ads:loadAdOnCreate="true"
 ads:adSize="BANNER"
 ads:adUnitId="KEY" />

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Volume Bug (Solved)

I can’t believe I fixed this bug! I actually fixed two bugs at once. They were very related. My app had tasks running in the background and that was causing some strange bugs. I fixed it like this:

It turns out that something was causing a task to not be killed. It was bugging the phones volume and the app was running in the background and consuming RAM and battery. I solved it by killing the all the tasks myself.

Add KILL_BACKGROUND_PROCESSES to the manifest. Then kill the tasks.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


@Override
 protected void onDestroy() {
 // TODO Auto-generated method stub
 super.onDestroy();
 final ActivityManager amm = (ActivityManager) WebViewPager.this.getSystemService(Activity.ACTIVITY_SERVICE);
 amm.restartPackage("com.liyicky.dbzhd");
 amm.killBackgroundProcesses("com.liyicky.dbzhd");

}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I’m so happy I solved this bug, it was extremely frustrating. It’s not good to have an app with such a huge bug on the market.

Volume Bug

I have a huge bug in my app. After I finish the app the volume is muted and it’s locked.

Even when I quit and restart the app the volume is still locked at mute. The only way to restore the volume is to restart the phone. 

The log says this every time I push the volume button:

02-18 12:48:09.429: W/KeyCharacterMap(16493): Error loading keycharmap file ‘/system/usr/keychars/m3_keypad.kcm.bin’. hw.keyboards.65538.devname=’m3_keypad’

 

Pretty frustrating. I’ve been working on it for a few days and nothing I try does anything. I think the youtube jtv ad is causing this but I don’t really know. People with ad block tell me they don’t get this bug; that is what leads me to suspect the ad. Squashing this bug is gonna be challenging. It’s definitely because I’m using Flash that i’m getting all these weird bugs. Flash is so difficult to use. Solve 1 bug and 3 more pop up. 

Socrata App

I started dev on my new app today. I had such a good break I wanted to write about it. This Soda-Java api is really confusing and new to me. It took me a while but I’ve got access the those sweet methods finally! Trial and error for the win. If things continue to go this well then this app shouldn’t be that difficult to complete. Soon this delicious data will be mine for free ;D

I also got my first donation from my DBZ app. 1$! It made my day. ♥

http://data.cityofnewyork.us/api/views/maj4-ux6k/rows.json

Dragon Ball Z HD TV v2.0 Released

I’ve just released v2.0 of DBZHD! I wasn’t planning on finishing it all in one day but I got stuck on one problem that sucked me in.

I was having a huge problem with Flash Player. The flash video play can’t be controlled by java and it’s a huge pain in the ass. I was trying to build a layout that can swipe between a full screen video webview and a full screen chat webview. The problem was that the flash video screen can’t be affected by java so once I focused on it, it wouldn’t leave the screen even if I switched children. I worked on it forever.  Then I finally figured out a way that works nicely with swipe. I can wrap the webview in a framelayout and remove the view from the framelayout whenever I swipe. It looks great!

I’ve fixed all the big bugs in this update. I’m very proud of it now. Can’t wait to release my next app!

ImageImage

Dragon Ball Z HD TV V2!!

I was just beginning to research info on how to make my next app when I discovered a way to make my DBZ app much better. I’m going to use MotionEvents and special URLs that let me load the stream and the chat in fullscreen. I’m really excited because I think this will make the app much better. I may even have it finished by tomorrow.

Dragon Ball Z HD TV v1.2 Released

I just published v1.2 of the DBZ stream app. I got over 2000 downloads so far so I really wanted to release a bug fix update and make the app look a little nicer. The most difficult thing I accomplished was implementing the PayPal library. It was worth the effort thou, I’ve learned a lot from it. The library sample code was really good and I want to start making my code resemble it somewhat. I loved making this app, it was a lot of fun. I’m going to keep updating it, but tomorrow I’m going to get started on my next app.

Image

PayPal Woes (Solved)

I’ve gotten PayPal up and running. I had to submit the api to their site. That was a joy; but it’s now up and live! Now I just need to update the orientation handler so I can set api 18 as the target. I don’t think it will take me more than a day to figure out. So If I get it done tomorrow then I can release a Sunday update! So stoked

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 public class DonateView extends Activity implements OnClickListener {

	private PayPal pp;
	private AdView adView;
	private ProgressDialog ppDialog;
	private CheckoutButton payButton, payButton2;
	private EditText amount;
	private String aString;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);

		initLibrary();

		ScrollView scroller = new ScrollView(this);
		scroller.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,
				LayoutParams.MATCH_PARENT));

		amount = new EditText(this);
		amount.setText(".99");
		amount.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
		amount.setGravity(Gravity.CENTER_HORIZONTAL);
		amount.setHint("Donation Amount");
		amount.setTextSize(20f);
		amount.setPadding(40, 10, 40, 0);
		amount.setInputType(InputType.TYPE_CLASS_PHONE);

		LinearLayout simplePay = new LinearLayout(this);
		simplePay.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,
				LayoutParams.MATCH_PARENT));
		simplePay.setBackgroundColor(Color.TRANSPARENT);
		simplePay.setGravity(Gravity.CENTER_HORIZONTAL);
		simplePay.setPadding(10, 10, 10, 10);
		simplePay.setOrientation(LinearLayout.VERTICAL);
		simplePay.setBackgroundResource(R.drawable.pp_bg2);

		RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
				LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
		params.addRule(RelativeLayout.ALIGN_BOTTOM);
		params.topMargin = 20;
		payButton = pp.getCheckoutButton(this, PayPal.BUTTON_194x37,
				CheckoutButton.TEXT_DONATE);
		payButton.setOnClickListener(this);
		payButton.setLayoutParams(params);

		TextView btnLabel = new TextView(this);
		btnLabel.setGravity(Gravity.CENTER_HORIZONTAL);
		btnLabel.setText("Donate to DBZ-HD Stream");
		btnLabel.setTextSize(16f);
		btnLabel.setTypeface(null, Typeface.BOLD);
		btnLabel.setTextColor(Color.BLACK);

		LinearLayout btnHolder = new LinearLayout(this);
		btnHolder.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,
				LayoutParams.WRAP_CONTENT));
		btnHolder.setGravity(Gravity.CENTER_HORIZONTAL);
		btnHolder.setOrientation(LinearLayout.VERTICAL);
		btnHolder.setBackgroundColor(Color.TRANSPARENT);
		btnHolder.setPadding(0, 40, 0, 40);
		btnHolder.addView(payButton);
		btnHolder.addView(btnLabel);

		RelativeLayout.LayoutParams params2 = new RelativeLayout.LayoutParams(
				LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
		params2.addRule(RelativeLayout.ALIGN_BOTTOM);
		params2.topMargin = 20;
		payButton2 = pp.getCheckoutButton(this, PayPal.BUTTON_194x37,
				CheckoutButton.TEXT_DONATE);
		payButton2.setOnClickListener(this);
		payButton2.setLayoutParams(params2);

		TextView btnLabel2 = new TextView(this);
		btnLabel2.setGravity(Gravity.CENTER_HORIZONTAL);
		btnLabel2.setText("Donate to DBZ-HD App");
		btnLabel2.setTypeface(null, Typeface.BOLD);
		btnLabel2.setTextSize(16f);
		btnLabel2.setTextColor(Color.BLACK);

		LinearLayout btnHolder2 = new LinearLayout(this);
		btnHolder2.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,
				LayoutParams.WRAP_CONTENT));
		btnHolder2.setGravity(Gravity.CENTER_HORIZONTAL);
		btnHolder2.setOrientation(LinearLayout.VERTICAL);
		btnHolder2.setBackgroundColor(Color.TRANSPARENT);
		btnHolder2.setPadding(0, 20, 0, 20);
		btnHolder2.addView(payButton2);
		btnHolder2.addView(btnLabel2);
		
		adView = new AdView(this, AdSize.BANNER, "Put a key here");
		adView.loadAd(new AdRequest());

		simplePay.addView(amount);
		//simplePay.addView(btnHolder);
		simplePay.addView(btnHolder2);
		simplePay.addView(adView);
		scroller.addView(simplePay);
		setContentView(scroller);
	}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~