Simple Android Dev's Blog
Android starter developer's blog, let's learn together!
Nov 27, 2012
May 4, 2012
Game development on Android, part 2: Porting from iPhone Cocos2D
If you're going to port game from iPhone Cocos2D - here is a good link from a man, who did it!
http://www.cocos2d-iphone.org/forum/topic/21210
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.
Mar 6, 2012
Your Accountant - Version 1.0 released
Do You need all your spendings noted and categorized? Do You spend a lot of time calculating money? Want to know where do You spend all the money?
Our Accountant was created for You!
This little helper will keep in memory all the spendings and make statistics.
- Note all the spendings
- Sort them by groups
- Accounts support
- Create a templates to save time on creating new records
- Create notifications in system calendar
- Simple and smart user interface
- Note all the spendings
- Sort them by groups
- Accounts support
- Create a templates to save time on creating new records
- Create notifications in system calendar
- Simple and smart user interface
Jan 13, 2012
Android Design
Good news everybody!
Google has opened new resource for us to help in designing Android applications. It's Android Design.
I recommend you to read it carefully and make more and more great-looking apps! :)
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 ListitemsUrls; 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
Subscribe to:
Posts (Atom)