NEW – Now you can see your current location by choosing the store you are near. This will allow you to see where you are in relation to where you want to go.  We opted for choosing your location because the 3G and GPS are very unreliable in the mall and would not work all the time.

This is a store guide for the Megamall in Bloomington, MN, otherwise known as the Mall Of America. You can filter stores by category, floor, or direction/location. You can tap on a store name and see the location of the store on a map of the Mall along with your current location on the map. This is perfect for finding the stores you are looking for quickly or just discovering new stores in the categories you are interested in. Includes shopping list feature so you can keep track of those Black Friday deals and Holiday gifts!

This is a FREE application and you can grab it now by searching for ‘Mall of America’ in the market or scan the following bar code using bar code scanner

Post to Twitter Tweet This Post

Megamall in MN (Mall Of America) iPhone App

Posted December 16th, 2010. Filed under Applications

“Megamall in MN” is a store guide for the Mall Of America® in Bloomington, MN. Filter stores by category, floor, direction and location. Select store to see where it is located on a map of the mall. Includes shopping list feature so you can keep track of those holiday gift ideas. See it in itunes here

Post to Twitter Tweet This Post

Android ListView with fast scroll and section index

Posted December 3rd, 2010. Filed under Tutorial

This small tutorial will show you how to create a ListView, enable fast scrolling, and create a alphabetical section list that displays the letter as you quickly scroll the list.

First lets create a layout file with a ListView in it list this

<?xml version="1.0" encoding="utf-8"?>
 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:background="@drawable/background">
 
    <ListView
            android:id="@+id/thelist"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:scrollbars="vertical"
            android:fadingEdge="vertical"
            android:cacheColorHint="#00000000"
            android:fastScrollEnabled="true"
            android:padding="2dp">
    </ListView>
</LinearLayout>

Notice I am putting a background image on the layout and setting the ListView to be transparent with the cacheColorHint. I also set fastScrollEnabled to true.

Now I have a store object to store the attributes about a store

public class Store {
 
    public int id;
    public String name;
    public String direction;
    public int floor;
    public String address;
    public String category;
    public String phone;
}

finally we need to create the Activity. We will assign a custom ArrayAdapter to the list and the custom ArrayAdapter will implement SectionIndexer

/**
 * The Store List Activity
 */
public class StoreListActivity extends Activity {
    private DBAdapter db;
 
    private LinkedList<Store> storeList = new LinkedList<Store>();
    private StoreListAdaptor storeListAdaptor;
 
    private ListView list;
 
    /**
     * Called when the activity is first created.
     */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
 
        setContentView(R.layout.storelist);
 
        list = (ListView) findViewById(R.id.thelist);
 
        // populate the store list
        storeList = db.getAllStoresOrderByName(storeList);
 
        // create an adaptor with the store list
        storeListAdaptor = new StoreListAdaptor(this,storeList);
 
        // assign the listview an adaptor
        list.setAdapter(storeListAdaptor);
 
    }
 
    /**
     * The List row creator
     */
    class StoreListAdaptor extends ArrayAdapter<Store> implements SectionIndexer{
 
        HashMap<String, Integer> alphaIndexer;
        String[] sections;
 
        public StoreListAdaptor(Context context, LinkedList<Store> items) {
            super(context, R.layout.storerow, items);
 
            alphaIndexer = new HashMap<String, Integer>();
            int size = items.size();
 
            for (int x = 0; x < size; x++) {
                Store s = items.get(x);
 
		// get the first letter of the store
                String ch =  s.name.substring(0, 1);
		// convert to uppercase otherwise lowercase a -z will be sorted after upper A-Z
                ch = ch.toUpperCase();
 
		// HashMap will prevent duplicates
                alphaIndexer.put(ch, x);
            }
 
            Set<String> sectionLetters = alphaIndexer.keySet();
 
	    // create a list from the set to sort
            ArrayList<String> sectionList = new ArrayList<String>(sectionLetters); 
 
            Collections.sort(sectionList);
 
            sections = new String[sectionList.size()];
 
            sectionList.toArray(sections);
        }
 
       public View getView(int position, View convertView, ViewGroup parent) {
            // expand your row xml if you are using custom xml per row
       } 
 
       public int getPositionForSection(int section) {
           return alphaIndexer.get(sections[section]);
       }
 
       public int getSectionForPosition(int position) {
           return 1;
       }
 
       public Object[] getSections() {
            return sections;
       }
    }
}

Hope this helps

Post to Twitter Tweet This Post

If you are building iOS applications and using SVN you may have had issues getting your @2x resources for Retina Display Support added to svn. I used the command line on Mac OSX and I figured I could just use the standard backspace escape.. no dice. This turns out to be caused by internal path recognizers in svn. It expects the last at symbol to specify a revision. You can get around this by adding the symbol at the end of your file name. So if you are trying to add Default@2x.png you would do it like this

$ svn add Default@2x.png@

If you have a number of files to add you can save your self some time by taking advantage of the unix tools available. The following command would add all the images in the directory

$ svn status | grep '^?' | grep @2x | sed -e 's/.png/.png@/' | awk '{print $2}' | xargs svn add

You can than commit them all by using this

$ svn status | grep -v '^?' | grep @2x | sed -e 's/.png/.png@/' | awk '{print $2}' | xargs svn commit -m "add images"

Hope this helps..

Post to Twitter Tweet This Post