Android tutorial: How to set a custom wallpaper
Wallpapers are a nice way to customize your homescreen. There are many applications that allow you to change your wallpaper and they have huge databases with alot of wallpapers. An example is Zedge.
But the main question is:
How to they do it?
If we take a look at how this is done, it's pretty simple. In this tutorial i'll explain the basics ( really the basics
) of how you can make your own Wallpaper-changer-application-thingy!
This tutorial will cover the following subjects:
- A GridView to  show the wallpapers
- Implement a custom Adapter to show our images
- The code required to set a new wallpaper
Follow me after the break to learn how I put this together.
Android tutorial: Game menu with a custom Font
Android game development is HOT! I really get a lot of mails / requests for more game oriented tutorial. So here is one just for all you starting Android game developers out there! This post will explain how to make a simple game menu in Android. As always the source code is in the bottom! Want more about game development? There is a tag that holds all posts about game development
Here is a list with features that the finished menu will have:
- a nice background
- a custom font
- a style for making clean menu buttons
- a sub-menu with settings for your game
- settings will be saved in persistent storage ( with SharedPreferences )
Here is a picture of the complete menu.
Jump over to the entire post to see some code!
Merging 2 tutorials: XML data & ProgressDialog using ASyncTask
This post is just to for fill a request of one of the commentors / commentators ( you get the meaning
). He asked if i could show an example that combines these 2 tutorials:
- Android tutorial: How to parse XML to a Android ListView
- Android tutorial:Â How to implement a ProgressDialog
So i started off with the XMLtest code from the 1st tutorial. ( you can download the Eclipse project at the bottom of the XML tutorial ). Its pretty simple to implement a ProgressDialog. Apposed to the original tutorial i will be implementing a ASyncTask.
Quote from official docs:
An asynchronous task is defined by a computation that runs on a background thread and whose result is published on the UI thread. An asynchronous task is defined by 3 generic types, calledÂ
Params,ÂProgressandÂResult, and 4 steps, calledÂonPreExecute,ÂdoInBackground,ÂonProgressUpdateandÂonPostExecute.
Android development tutorial: reading SOAP services!
I have found that in a lot of cases, applications need data ! What a discovery
. The next question of course is: Where do i get my data from. Most of the time you can gather your data from a existing source and in a lot of cases you can manipulate the data because you also control that side of the application. More often than you think you can get useful (free) data from existing sources that you don't own. Thats where webservices come in. Webservices can give you usefull data in a lot of formats.
In previous posts is explained how to make you own webservice in PHP and how to read and parse JSON or XML, but another (pretty big) format is SOAP. In this post we will see how you make a application that reads and parses SOAP data into a Android application!
So to sum up what we will do:
- Make a call to a SOAP webservice ( this one , yes hello world!)
- Read and parse the output
- Display the webserver message in the Activity
Well that's more then enough for 1 tutorial i guess
Lets get started.
Android tutorial: How to make a basic splash screen
The following code will show you how to create a basic splashscreen for your Android application that will stay for 5 seconds. If we don't want to wait we can tap the screen to go directly to the next Activity. Source project is on the bottom of the tutorial.
The project has:
- 2 Activities
- 1 Image
- 0 Animations
Lets go through the code to see how simple it is to make a very basic splash screen for your application.
The splashscreen will be the startup Activity for our application and on application launch a Thread will start that will listen for touch events.
Implementing Facebook into your App: invalid key with keytool
I recently had an annoying error. I wanted to implement some "Post to Facebook" functionality to my application and i got an error saying that my key vas invalid...
To implement this I just followed the official implementation of the SDK and after a quick search it seems that its is a problem that more developers run into.
I found the answer to my problem on StackOverflow. Mr. Omsn just makes the key that the Facebook API wants from within your application.
Here is a quick code snippet:
try {
PackageInfo info = getPackageManager().getPackageInfo("**YOURPACKAGENAME**", PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
Log.i("PXR", Base64.encodeBytes(md.digest()));
}
}
catch (NameNotFoundException e) {}
catch (NoSuchAlgorithmException e) {}
Only thing you need is 1 extra class (Base64) to get this working. I used this one.
one other thing i changed is the application type to "Native App" in the Facebook application registry.
I made a simple Eclipse project that prints the key to the LogCat window. I hope this helps you guys, whenever you run into this problem.
Edit: this appears to be a Windows problem. You can also install Cygwin and run the keytool command in the Cygwyn shell








