Friday, August 9, 2013

How to save data in Android app

This post will be about saving data to text file in Android development. Android uses a class called SharedPreferences. Within your activity create an instance of the class

SharedPreferences sp;
TextView tv;
Button b1;
EditText et1;

Then name a string that will be the name of the file.

final static String filename = "MyData";

Within the onCreate bundle method make your declaration.

sp = getSharedPreferences(filename,0);

tv = (TextView)findViewById(R.id.textView1);

b1 = (Button)findViewById(R.id.button1);

et1 = (EditText)findViewById(R.id.edit1);

tv.setText(sp.getString("key","No data yet");


public void onClick() {

String test = et1.getText().toString();

SharedPreferences.Editor editor = sp.edit();

editor.putString("mykey",test);

sp.commit();


}


Check out my new movie, live music and book app for iPhone

How to create a thread in Android Development

I figured it's been a while since making a post on Android development, so today I will provide an example of a thread. A thread is a way that multiple activities can occur simultaneously in Android while using memory in an efficient way. In an Android app, it is standard to have an intro screen begin before being passed to a home activity or menu. Below is an example.

Thread myTimer = new Thread() {

public void run() {

try {

int timer =0 ;
while(time<5000) {


timer = timer + 100;
sleep(100);

}

startActivity(new Intent("com.activityname.clear"));
} catch(Exception e) {

e.printstacktrace();

}


}



};

myTimer.start();

Don't forget to try out my new app for movies, music and books

Live music app for iPhone

Mike's Movie and Concert Guide is the ideal multi-purpose app to satisfy your entertainment needs. If you enjoy live music, find your favorite local band and where they're playing. Use the photo search to browse photographs and utilize social media to find what's trending near you. Search by event, location or by artist. Get music reviews and news as well. Download concert finder today from the iTunes App Store

Thursday, August 8, 2013

Movie app for iPhone

Mike's Movie & Concert Guide is a one-stop download to fulfill many of your entertainment needs. This application is divided into four sections: Movies, Movie Trivia, Concerts and Books. Within the movie section, browse what movies are in theaters, search a movie database, discover new movies, find new releases on DVD and find local theaters with your geolocation. The trivia game tests your knowledge of movies, directors and actors. If you enjoy live music, find your favorite local band and where they're playing. Use the photo search to browse photographs and utilize social media to find what's trending near you. After your long night out, relax the following day with the Books section of the application. Search by title or author to discover new books. Also, once you've found a book that interests you, search the app's Book Review section.

Download entertainment app from iTunes App Store