Author Archive

Android: Dialog Box with an EditText

A simple code snippet I found over at, shows how to create a dialog box with an EditText in it. I needed it to save a user’s login name into the preferences when first starting a program, but it pretty much has a limitless amount of uses

AlertDialog.Builder alert = new AlertDialog.Builder(this);


// Set an EditText view to get user input 
final EditText input = new EditText(this);

alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
  String value = input.getText();
  // Do something with value!

alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
  public void onClick(DialogInterface dialog, int whichButton) {
    // Canceled.

-Kevin Grant

Prince William: Put a ring on it!

At phamous-apps, we’re shameless fans of the royal wedding, and in lieu of this, we’re giving you another precious gem for your application arsenal. We present to you…

Prince William: Put a ring on it!

A simple mini-game where you can put a ring on Prince Williams finger. Description from the marketplace

The Royal Wedding is soon, and Prince William is refusing to wear his ring. Kate Middleton seems ok with it, but we all know that shes not!
In this minigame, “Put a Ring On it!” you need to put as many rings on the Prince’s hand as possible! Rack up a high score, let him know that you want that ring on there!

There seem to be some problems if you have a ridiculously large screen where the hand moves too fast, but just think of it as “expert mode” and you’ll be fine, until we can fix it anyways 😉

Is there an Android API for Google Maps 5.0?

I’ve been looking for this for some personal projects today. After a few hours of research and testing on 3/29/2011, my definitive answer is no.

There remains an unanswered comment on the official blog post about it here from December, and when using the latest 2.3.3 Google APIs in the SDK, I still receive tile based maps. I have also found numerous unanswered questions from stackoverflow and other QA sites to back up my statement that it is currently unavailable.

I will update this post when the Maps 5.0 API becomes updated, or if anyone hears otherwise before I do, please comment!

What is an immutable array? What does immutable mean in coding?

I got an email from about some coding questions. Pretty much they are looking to hire some new people and are using these questions to generate interest / find candidates. The full list can be found here, but one question in particular I got lost in terminology slightly.

Imagine we have an immutable array of size N which we know to be filled with integers ranging from 0 to N-2, inclusive.

Did I learn about immutable in college? Maybe. Do I remember it? Certainly not. I googled for a few minutes, figured it out. As per usual, stackoverflow is a great place for answers.

A mutable object is simply an object that can be modified after it’s created/instantiated, vs an immutable object that cannot be modified.


So that’s what the keyword is, hope you learned something!

-Kevin Grant

Golden AP Gets to shine a little brighter today as well…

We don’t get too many downloads on Mobile AP Gold, and thats ok! The whole reason we made Mobile AP Shortcut to begin with is because we wanted everyone to have 1 button access to turn on Mobile AP! But, our select few gold members, we do love you, so Golden AP has been updated with slight differences from Mobile AP, to make sure you feel the distinction.

The largest distinction is we left the shortcut itself as an app, and slightly changed its icon to reflect its functionality. The widget in Golden AP is a 1×1 instead of a 2×1, and its only function is for one button enabling / disabling your mobile hotspot. This way if you don’t want the settings shortcut tacked on, you don’t have to. And of course, there is no 5 second ad delay (we’re bastards, we know).

Check out the screenshots and the table below, choose for yourself!

Whats the big difference anyways?! Golden AP Mobile AP
Access to Mobile AP Settings on all compatible phones: Yes Yes
Access to 1 touch enable on all compatible phones: Yes Yes
Sweet Gold Icon Yes No
Has ads No Yes
Widget Size 1×1 2×1
Has Shitty Graphics Yes Yes
Buys us 1 cup of ramen: Yes If you click the ad 69 times

You can buy Golden AP here for only $.99 USD.

-Kevin Grant

Android Apps: Golden / Mobile AP Shortcut 3.0 is here!

We are proud to announce Golden and Mobile AP Shortcut 3.0! We skipped 2.0 because we felt like it! After hours of laboring, we have figured out how to turn this handy dandy application from a helpful shortcut to an AMAZING WIDGET! Check out the screens below, and head to marketplace for Golden AP Shortcut for the paid version or Mobile AP Shortcut for the ad version.

-Kevin Grant

Android: What does “Volatile” mean?

At work, I’m currently working on a very large project, and a lot of it was previously written by some very experienced programmers, far beyond my level of skill. When I read through it, I often come across weird things I’ve never seen before (a lot of which gives me the content to post here!) One of these I cam across recently was this word:


Its a strange prefix to a variable name, and the first few times I looked it up, I was not able to find a clear or concise answer. When I try to compile it into simple programs, it never yielded any visible differences. I have found this article from Javamex which put together a rather simple table and explanation of what it actually does.

Essentially, volatile is used to indicate that a variable’s value will be modified by different threads.

Briefly, I can tell you it is related to threads and synchronization, so if your programs don’t have a lot of multi thread functionality, this keyword *probably doesn’t affect you. Check out the article here and feel free to toss in any comments to shed light some more light for our readers!

-Kevin Grant

Android: Getting screen pixel size and dimensions

In one of our programs, I hackishly figured out how to get screen size based off of measuring a view in the onDraw() method and only doing it the first onDraw, and blah yada blah etc. This was terrible and I knew it from the beginning, but it works, so whatever. However, I have run into the same problem into a different project and that method won’t work here, so I researched it again. Low and behold, it was much easier that I ever thought (just like everything else).

DisplayMetrics metrics = new DisplayMetrics();

and now you can access everything you want through this “metrics” variable. Found this right on the android site under Display Metrics

-Kevin Grant

Mobile AP 3.0 teaser…

-Kevin Grant

Android: Ain’t no Callerback grl… (Callback functions in Android)

When I learned about callback functions in Android, it literally created a whole new world of possibilities of what I could do withing my apps. For so long I had used callback functions without even knowing it! An example of a callback function we all already use is with buttons and the onClickListener(). Usually when you create a button, you register a listener, and then you put code into it, like so:

Button btn = (Button) findViewById(yada_yada_yada);
btn.setOnclickListener(new OnClickListener(){
	public void onClick(View v){
		// do something

Basically, whenever you press a button, it sends a callback to this listener you set, and your program can do whatever you want in here. What we want to do now is replicate this sort of callback, but not for a button press. We want to replicate this for ANYTHING! In the example code I provide, we can now do things like this:

rst = new RandomSenderThingy();
rst.setRandomThingyListener(new RandomSenderThingyListener(){
	public void onBoolThingChanged(boolean changed) {
		Log.d("DEBUG","Callback Received! It is: " + changed);

The example code makes use of a few various techniques to get the point across, but I’ve clearly commented the parts that you will need to inject into your own code to get this functionality. Good luck and post any questions or comments in the comments section!

Download the source code here

-Kevin Grant