Android ListView black background when scrolling problem

ListViews in Android as explained here uses Android’s black color as the default background. If you change this background the default behavior is for the ListView to cache the default color for optimazation.

To fix this issue, all you have to do is either disable the cache color hint optimization, if you use a non-solid color background, or set the hint to the appropriate solid color value. This can be dome from code or preferably from XML, by using the android:cacheColorHint attribute. To disable the optimization, simply use the transparent color #00000000.

example:

<ListView android:id="@android:id/list" android:layout_width="fill_parent"
		android:layout_height="fill_parent" android:layout_weight="1"
		android:layout_gravity="top" android:cacheColorHint="#00000000">
  • Facebook
  • Google Bookmarks
  • Twitter
  • FriendFeed
  • Google Gmail
  • Blogger Post
  • Google Buzz
  • Google Reader
  • Hotmail
  • WordPress
  • Share/Bookmark
Posted in Android Code Tips Programming by Konstantinos Polychronis. No Comments

________________________________________________________________

Simple AlertDialog tutorial

How to create a AlertDialog to display a message in Android:

final AlertDialog alertDialog = new AlertDialog.Builder(YourActivity.this).create();
alertDialog.setTitle(getString(R.string.app_name));
alertDialog.setIcon(R.drawable.icon);
alertDialog.setMessage("Your message here");
alertDialog.setButton("Back", new DialogInterface.OnClickListener() {
		public void onClick(DialogInterface dialog, int which) {
			alertDialog.dismiss();
		}
});
alertDialog.show();
  • Facebook
  • Google Bookmarks
  • Twitter
  • FriendFeed
  • Google Gmail
  • Blogger Post
  • Google Buzz
  • Google Reader
  • Hotmail
  • WordPress
  • Share/Bookmark
Tags: , , , ,
Posted in Android Code Tips Programming by Konstantinos Polychronis. No Comments

________________________________________________________________

A Java Obfuscator for Android

ProGuard is a free Java class file shrinker, optimizer, obfuscator, and preverifier. It detects and removes unused classes, fields, methods, and attributes. It optimizes bytecode and removes unused instructions. It renames the remaining classes, fields, and methods using short meaningless names.

Does ProGuard work for Google Android code?

Yes. Google’s dx compiler converts ordinary jar files into files that run on Android devices. By preprocessing the original jar files, ProGuard can significantly reduce the file sizes and boost the run-time performance of the code.

Promise to write a tutorial :)

http://proguard.sourceforge.net/

  • Facebook
  • Google Bookmarks
  • Twitter
  • FriendFeed
  • Google Gmail
  • Blogger Post
  • Google Buzz
  • Google Reader
  • Hotmail
  • WordPress
  • Share/Bookmark
Tags: ,
Posted in Android Android Code Tips by Konstantinos Polychronis. No Comments

________________________________________________________________

Social Media

Social Media:

  • Facebook
  • Google Bookmarks
  • Twitter
  • FriendFeed
  • Google Gmail
  • Blogger Post
  • Google Buzz
  • Google Reader
  • Hotmail
  • WordPress
  • Share/Bookmark
Tags:
Posted in Uncategorized by Konstantinos Polychronis. No Comments

________________________________________________________________

scp with no ecryption

I use scp A LOT. And I love scp A LOT.

The SCP protocol is a network protocol that supports file transfers. The SCP protocol, is based on the BSD RCP protocol which is tunneled through the Secure Shell (SSH) protocol to provide encryption and authentication.

Most of the times, when transferring data files in my local network, there is no need for encryption. It that case you can avoid the encryption part and gain much in speed.

It seems that the use of scp with the “-c none” flag is not working since version 2, so rcp is now the preffered choice!
example:
rcp localfile.txt ventrix@localmachine:

  • Facebook
  • Google Bookmarks
  • Twitter
  • FriendFeed
  • Google Gmail
  • Blogger Post
  • Google Buzz
  • Google Reader
  • Hotmail
  • WordPress
  • Share/Bookmark
Tags: ,
Posted in GNU/Linux by Konstantinos Polychronis. 2 Comments