Author Archive

Android: Dialog Box with an EditText

A simple code snippet I found over at http://www.androidsnippets.com/, 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);

alert.setTitle("Title");
alert.setMessage("Message");

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

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.
  }
});

alert.show();

-Kevin Grant

Advertisements

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 rapleaf.com 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.

source

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:

volatile

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