Showing posts with label android. Show all posts
Showing posts with label android. Show all posts
Nov 27, 2012
May 4, 2012
Game development on Android, part 1: Game Loop
I've found pretty good article for gamedev starters: http://www.koonsolo.com/news/dewitters-gameloop/
Here you can read about good paractices about game loop development.
Jan 11, 2012
Отличный обзор новых устройств Sony на Android с CES-2012
Вот обзор Android-устройств Sony от mobile-review.com c CES 2012, хотеть-хотеть :)
Dec 20, 2011
Asynchronous ListView image and data loading in Android
Hi! Today I'm going to tell you how to load data in ListView items asynchronous in Android.
First. For example we'll build a list of images, that we download from the Internet.
Second. ListView item is the simple LinearLayout with ImageView.
Third. Our adapter code:
Here it is, now we have the async image loading as in different twitter clients.
First. For example we'll build a list of images, that we download from the Internet.
Second. ListView item is the simple LinearLayout with ImageView.
Third. Our adapter code:
public class ImageListAdapter extends BaseAdapter {
private List itemsUrls;
private Context ctx;
public FeedListAdapter(Context ctx) {
this.ctx = ctx;
}
private class ViewHolder {
public ImageView image;
}
@Override
public int getCount() {
return itemsUrls.size();
}
@Override
public Status getItem(int pos) {
return itemsUrls.get(pos);
}
@Override
public long getItemId(int pos) {
return pos;
}
@Override
public View getView(int pos, View convertView, ViewGroup parent) {
View v = convertView;
if(v == null){
LayoutInflater vi = (LayoutInflater) ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(R.layout.status_item, null);
ViewHolder holder = new ViewHolder();
holder.image = (ImageView) v.findViewById(R.id.image);
v.setTag(holder);
}
ViewHolder holder = (ViewHolder)v.getTag();
//Setting the image url as a tag for the image view
holder.image.setTag(items.get(pos));
holder.image.setImageDrawable(null);
//starting async task for image loading
new ImageTask().execute(holder);
return v;
}
private class ImageTask extends AsyncTask {
private ImageView avatarImage;
private Bitmap av = null;
private String url;
@Override
protected void onPostExecute(Boolean result) {
super.onPostExecute(result);
if(result && av != null) {
if(avatarImage.getTag().toString().equals(url)) {
avatarImage.setImageBitmap(av);
}
}
}
@Override
protected Boolean doInBackground(ViewHolder... params) {
ViewHolder item = (ViewHolder) params[0];
boolean result = false;
if(item != null) {
try {
avatarImage = item.image;
url = item.image.getTag().toString();
av = getBitmapMethod(url);
result = true;
} catch (Exception e) {
e.printStackTrace();
}
}
return result;
}
}
}
Here it is, now we have the async image loading as in different twitter clients.
Labels:
adapter,
android,
asynchronous loading,
asynctask,
listview
Oct 31, 2011
Android OpenGL ES 1.0: How to load non-power of 2 bitmaps
Hi all.
Today I will show my code for loading non-power of 2 bitmaps for textures.
Quite simple.
Today I will show my code for loading non-power of 2 bitmaps for textures.
Quite simple.
Oct 27, 2011
Useful links
I thought some of you guys want to know smth new about Android, so here are the links to pages I've studied recently:
Android Fragments API:
CommonsWare (just buy and read it, this guy answers a lot of common questions):
In-app purchases for Android:
Google TV (russian):
Android 4.0 face recognition:
Labels:
android,
android market,
developer,
face recognition,
google tv
Flurry Mobile analytics
Sad, but Flurry Analytics didn't help.
The workflow is very simple.
You sign in, register an application, and then download an SDK and a application key.
Add the library to your project.
Then in the onStart() method of each activity You call FlurryAgent.onStartSession(this, "YOUR KEY HERE")
And call FlurryAgent.onEndSession(this) in onStop(). That's all! The info appears on the statistics page on about 30 minutes, which is way faster that Google Analytics.
But, this SDK can't track data to multiple keys at one time too.
The workflow is very simple.
You sign in, register an application, and then download an SDK and a application key.
Add the library to your project.
Then in the onStart() method of each activity You call FlurryAgent.onStartSession(this, "YOUR KEY HERE")
And call FlurryAgent.onEndSession(this) in onStop(). That's all! The info appears on the statistics page on about 30 minutes, which is way faster that Google Analytics.
But, this SDK can't track data to multiple keys at one time too.
Oct 12, 2011
Subscribe to:
Posts (Atom)
