Kampanye Damai Pemilu Indonesia 2009 ini diposting hanya untuk memberikan penguatan pada blog utama, karena persaingan di halaman-halaman awal jauh lebih berat dikarenakan beberapa pakar seo ikut andil dan turun gunung dalam kontes seo Kampanye Damai Pemilu Indonesia 2009 ini.Selamat melakukan optimasi di blog masing-masing buat semua peserta kontes seo kampanye damai pemilu indonesia 2009. Agak sulit menembus jajaran 10 besar di kontes ini. Saya berharap blog utama milik saya bisa nangkring di posisi 10 besar sampai dengan kontes seo ini berakhir di keyword Kampanye Damai Pemilu Indonesia 2009.Kemungkinan besar pengunjung untuk kata kunci Pemilu Indonesia 2009 akan meningkat dikarenakan Pemilu di Indonesia tinggal 2 bulan lagi, jadi kontes seo ini hadiahnya bukan hanya sekadar Uang tapi juga melatih kesabaran konsistensi dan juga membuat para politikus ataupun orang-orang yang mencari data tentang Kampanye Pemilu Indonesia 2009 akan terjebak di postingan Kampanye Damai Pemilu Indonesia 2009 yang berhamburan dari ratusan bahkan ribuan blog.
Thursday, February 26, 2009
Kampanye Damai Pemilu Indonesia 2009
Kampanye Damai Pemilu Indonesia 2009 ini diposting hanya untuk memberikan penguatan pada blog utama, karena persaingan di halaman-halaman awal jauh lebih berat dikarenakan beberapa pakar seo ikut andil dan turun gunung dalam kontes seo Kampanye Damai Pemilu Indonesia 2009 ini.Selamat melakukan optimasi di blog masing-masing buat semua peserta kontes seo kampanye damai pemilu indonesia 2009. Agak sulit menembus jajaran 10 besar di kontes ini. Saya berharap blog utama milik saya bisa nangkring di posisi 10 besar sampai dengan kontes seo ini berakhir di keyword Kampanye Damai Pemilu Indonesia 2009.Kemungkinan besar pengunjung untuk kata kunci Pemilu Indonesia 2009 akan meningkat dikarenakan Pemilu di Indonesia tinggal 2 bulan lagi, jadi kontes seo ini hadiahnya bukan hanya sekadar Uang tapi juga melatih kesabaran konsistensi dan juga membuat para politikus ataupun orang-orang yang mencari data tentang Kampanye Pemilu Indonesia 2009 akan terjebak di postingan Kampanye Damai Pemilu Indonesia 2009 yang berhamburan dari ratusan bahkan ribuan blog.
Android Layout Tricks #2: Reusing layouts
Android comes with a wide variety of widgets, small visual construction blocks you can glue together to present the users with complex and useful interfaces. However applications often need higher level visual components. A component can be seen as a complex widget made of several simple stock widgets. You could for instance reuse a panel containing a progress bar and a cancel button, a panel containing two buttons (positive and negative actions), a panel with an icon, a title and a description, etc. Creating new components can be done easily by writing a custom View
but it can be done even more easily using only XML.
In Android XML layout files, each tag is mapped to an actual class instance (the class is always a subclass of View.) The UI toolkit lets you also use three special tags that are not mapped to a View
instance: <requestFocus />
, <merge />
and <include />
. The latter, <include />
, can be used to create pure XML visual components. (Note: I will present the <merge />
tag in the next installment of Android Layout Tricks.)
The <include />
does exactly what its name suggests; it includes another XML layout. Using this tag is straightforward as shown in the following example, taken straight from the source code of the Home application that currently ships with Android:
<com.android.launcher.Workspace
android:id="@+id/workspace"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
launcher:defaultScreen="1">
<include android:id="@+id/cell1" layout="@layout/workspace_screen" />
<include android:id="@+id/cell2" layout="@layout/workspace_screen" />
<include android:id="@+id/cell3" layout="@layout/workspace_screen" />
</com.android.launcher.Workspace>
In the <include />
only the layout
attribute is required. This attribute, without the android
namespace prefix, is a reference to the layout file you wish to include. In this example, the same layout is included three times in a row. This tag also lets you override a few attributes of the included layout. The above example shows that you can use android:id
to specify the id of the root view of the included layout; it will also override the id of the included layout if one is defined. Similarly, you can override all the layout parameters. This means that any android:layout_*
attribute can be used with the <include />
tag. Here is an example:
<include android:layout_width="fill_parent" layout="@layout/image_holder" />
<include android:layout_width="256dip" layout="@layout/image_holder" />
This tag is particularly useful when you need to customize only part of your UI depending on the device's configuration. For instance, the main layout of your activity can be placed in the layout/
directory and can include another layout which exists in two flavors, in layout-land/
and layout-port/
. This allows you to share most of the UI in portrait and landscape.
Like I mentioned earlier, my next post will explain the <merge />
, which can be particularly powerful when combined with <include />
.
Tuesday, February 24, 2009
Android Layout Tricks #1
The Android UI toolkit offers several layout managers that are rather easy to use and, most of the time, you only need the basic features of these layout managers to implement a user interface. Sticking to the basic features is unfortunately not the most efficient way to create user interfaces. A common example is the abuse of LinearLayout, which leads to a proliferation of views in the view hierarchy. Every view, or worse every layout manager, you add to your application comes at a cost: initialization, layout and drawing become slower. The layout pass can be especially expensive when you nest several LinearLayout that use the weight parameter, which requires the child to be measured twice.
Let's consider a very simple and common example of a layout: a list item with an icon on the left, a title at the top and an optional description underneath the title. Here is what such an item looks like:
To clearly understand how the views, one ImageView and two TexView, are positioned with respect to each other, here is the wireframe of the layout as captured by HierarchyViewer:
Implementing this layout is straightforward with LinearLayout. The item itself is a horizontal LinearLayout with an ImageView and a vertical LinearLayout, which contains the two TextViews. The source code of this layout is the following:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:padding="6dip">
<ImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginRight="6dip"
android:src="@drawable/icon" />
<LinearLayout
android:orientation="vertical"
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="fill_parent">
<TextView
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:gravity="center_vertical"
android:text="My Application" />
<TextView
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:singleLine="true"
android:ellipsize="marquee"
android:text="Simple application that shows how to use RelativeLayout" />
</LinearLayout>
</LinearLayout>
This layout works but can be wasteful if you instantiate it for every list item of a ListView. The same layout can be rewritten using a single RelativeLayout, thus saving one view, and even better one level in view hierarchy, per list item. The implementation of the layout with a RelativeLayout remains simple:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:padding="6dip">
<ImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:layout_marginRight="6dip"
android:src="@drawable/icon" />
<TextView
android:id="@+id/secondLine"
android:layout_width="fill_parent"
android:layout_height="26dip"
android:layout_toRightOf="@id/icon"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:singleLine="true"
android:ellipsize="marquee"
android:text="Simple application that shows how to use RelativeLayout" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/icon"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_above="@id/secondLine"
android:layout_alignWithParentIfMissing="true"
android:gravity="center_vertical"
android:text="My Application" />
</RelativeLayout>
This new implementation behaves exactly the same way as the previous implementation, except in one case. The list item we want to display has two lines of text: the title and an optional description. When a description is not available for a given list item, the application would simply set the visibility of the second TextView to GONE. This works perfectly with the LinearLayout implementation but not with the RelativeLayout version:
In a RelativeLayout, views are aligned either with their parent, the RelativeLayout itself, or other views. For instance, we declared that the description is aligned with the bottom of the RelativeLayout and that the title is positioned above the description and anchored to the parent's top. With the description GONE, RelativeLayout doesn't know where to position the title's bottom edge. To solve this problem, you can use a very special layout parameter called alignWithParentIfMissing.
This boolean parameter simply tells RelativeLayout to use its own edges as anchors when a constraint target is missing. For instance, if you position a view to the right of a GONE view and set alignWithParentIfMissing to true, RelativeLayout will instead anchor the view to its left edge. In our case, using alignWithParentIfMissing will cause RelativeLayout to align the title's bottom with its own bottom. The result is the following:
The behavior of our layout is now perfect, even when the description is GONE. Even better, the hierarchy is simpler and because we are not using LinearLayout's weights it's also more efficient. The difference between the two implementations becomes obvious when comparing the view hierarchies in HierarchyViewer:
Again, the difference will be much more important when you use such a layout for every item in a ListView for instance. Hopefully this simple example showed you that getting to know your layouts is the best way to learn how to optimize your UI.
Monday, February 23, 2009
The Tips for Making Money Online Part 2
Search Engine Yahoo and Google are the top two sites where most of the web searches come from. Yahoo's directory, the Google Directory, and the Open Directory Project (dmoz) are web directories -- essentially subject indices. Search engine traffic is the one referred by search engine result page (SERP) like Google or Yahoo. Experts estimate that Google account for 45% of the searches while Yahoo gets 30%. Google, Yahoo and MSN are the top search engines to date. Another way to make money online is to utilize an auction website such as Ebay or Yahoo Auctions to sell unwanted merchandise that you own to others using the internet as a tool to do so. But it is only possible, if your website or blog is optimized for your visitors who are looking for quality information and for the search engines. I recommend advertising mainly with the larger, more reputable search engines to get the best traffic to your website.Conclusion Search Engine is ideal for websites with thousands of web pages. As I said in the part 1 already that, in many ways, starting a make money online business is no different to starting an off line one but online is a lot easier than you think. Ways to make money online is the same as addition and bandage a search clamp and again heave without nook, knock. The key to make money online is knowing how and where to start. Today I know that the challenge for anyone trying to make money online is figuring out what opportunity can make a difference for him. Although generating online traffic is an important goal of any website, attention should always be directed to the very first and most important issue in website marketing: targeting online customers. In summary, I believe that to make money online is not that hard.
Friday, February 20, 2009
Android Market update: priced applications for US users
Last Friday, we enabled developers to upload priced apps and saw a flurry of activity in the days that followed. Today, it is my pleasure to let you know that we have begun the phased rollout of priced applications to T-Mobile G1 users in the US. Once the service is enabled on their devices, T-Mobile G1 users will be able to see the priced apps immediately without the need to reboot. For more details on this update to Android Market, please see last week's blogpost.
Thursday, February 19, 2009
Faster screen orientation change
Android is a mobile operating system meant to be run on a wide array of devices, with very different hardware configurations. Some devices, like the T-Mobile G1, can change their hardware configuration at runtime. For instance, when you open the keyboard, the screen change from the portrait orientation to the landscape orientation. To make Android applications development easier, the OS automatically handles configuration changes and restart the current activity with the new configuration. This is the default behavior that lets you declare resources like layouts and drawables based on the orientation, screen size, locale, etc. If you are not familiar with the way Android handles resources, I highly suggest you to read the official documentation on resources.
While this behavior is really powerful, since your application adapts automatically to the device's configuration at runtime, it is sometimes confusing for new Android developers who wonder why their activity is destroyed and recreated. Facing this "issue," some developers choose to handle configuration changes themselves which is, in my opinion, a short-term solution that will complicate their life when other devices come out or when the application becomes more complex. The automatic resource handling is a very efficient and easy way to adapt your application's user interface to various devices and devices configurations. It sometimes comes at a price though.
When your application displays a lot of data, or data that is expensive to fetch, the automatic destruction/creation of the activities can be lead to a painful user experience. Take the example of Photostream, a simple Flickr browsing application I wrote for the release of Android 1.0. After you launch the application and choose a Flickr account, the application downloads a set of 6 photos (on a T-Mobile G1) from the Flickr servers and displays them on screen. To improve the user experience, I also use slightly different layouts and drawables in portrait and landscape, and this is what the result looks like:
Photostream lets Android take care of the configuration change when the screen is rotated. However, can you imagine how painful it would be for the user to see all the images being downloaded again? The obvious solution to this problem is to temporarily cache the images. They could be cached on the SD card (if there's one), in the Application object, in a static field, etc. None of these techniques is adapted to the current situation: why should we bother caching the images when the screen is not rotated? Fortunately for us, Android offers a great API exactly for that purpose.
The Activity class has a special method called onRetainNonConfigurationInstance(). This method can be used to pass an arbitrary object your future self and Android is smart enough to call this method only when needed. In the case of Photostream, I used this method to pass the downloaded images to the future activity on orientation change. The implementation can be summarized like so:
@Override
public Object onRetainNonConfigurationInstance() {
final LoadedPhoto[] list = new LoadedPhoto[numberOfPhotos];
keepPhotos(list);
return list;
}
In the new activity, in onCreate()
, all you have to do to get your object back is to call getLastNonConfigurationInstance(). In Photostream, this method is invoked and if the returned value is not null, the grid is loaded with the list of photos from the previous activity:
private void loadPhotos() {
final Object data = getLastNonConfigurationInstance();
// The activity is starting for the first time, load the photos from Flickr
if (data == null) {
mTask = new GetPhotoListTask().execute(mCurrentPage);
} else {
// The activity was destroyed/created automatically, populate the grid
// of photos with the images loaded by the previous activity
final LoadedPhoto[] photos = (LoadedPhoto[]) data;
for (LoadedPhoto photo : photos) {
addPhoto(photo);
}
}
}
Be very careful with the object you pass through onRetainNonConfigurationChange()
though. If the object you pass is for some reason tied to the Activity/Context, you will leak all the views and resources of the activity. This means you should never pass a View, a Drawable, an Adapter, etc. Photostream for instance extracts the bitmaps from the drawables and pass the bitmaps only, not the drawables. Finally, remember that onRetainNonConfigurationChange()
should be used only to retain data that is expensive to load. Otherwise, keep it simple and let Android do everything.
Friday, February 13, 2009
Android Market update: support for priced applications
I'm pleased to announce that Android Market is now accepting priced applications from US and UK developers. Developers from these countries can go to the publisher website at http://market.android.com/publish to upload their application(s) along with end user pricing for the apps. Initially, priced applications will be available to end users in the US starting mid next week. We will add end user support for additional countries in the coming months.
We will also enable developers in Germany, Austria, Netherlands, France, and Spain to offer priced applications later this quarter. By the end of Q1 2009, we will announce support for developers in additional countries. Developers can find more information about priced applications in Android Market at http://market.android.com/support/
Google Checkout will serve as the payment and billing mechanism for Android Market. Developers who do not already have a Google Checkout merchant account can easily sign up for one via the publisher website.
Also, Android Market for free applications will become available to users in Australia starting February 15th Pacific Time and in Singapore in the coming weeks. Developers can now make their applications available in these countries via the publisher website at http://market.android.com/publish.
We look forward to seeing more great applications on Android Market.
Thursday, February 12, 2009
Track memory allocations
Despite the impressive hardware of the first Android phones (T-Mobile G1 and ADP1) writing efficient mobile applications is not always straightforward. Android applications rely on automatic memory management handled by Dalvik's garbage collector which can sometimes cause performance issues if you are not careful with memory allocations.
In a performance sensitive code path, like the layout or drawing method of a view or the logic code of a game, any allocation comes at a price. After too many allocations, the garbage collector will kick in and stop your application to let it free some memory. Most of the time, garbage collections happen fast enough for you not to notice. However, if a collection happens while you are scrolling through a list of items or while you are trying to defeat a foe in a game, you may suddenly see a drop in performance/responsiveness of the application. It's not unusual for a garbage collection to take 100 to 200 ms. For comparison, a smooth animation needs to draw each frame in 16 to 33 ms. If the animation is suddenly interrupted for 10 frames, you can be certain that your users will notice.
Most of the time, garbage collection occurs because of tons of small, short-lived objects and some garbage collectors, like generational garbage collectors, can optimize the collection of these objects so that the application does not get interrupted too often. The Android garbage collector is unfortunately not able to perform such optimizations and the creation of short-lived objects in performance critical code paths is thus very costly for your application.
To help you avoid frequent garbage collections, the Android SDK ships with a very useful tool called allocation tracker. This tool is part of DDMS, which you must have already used for debugging purposes. To start using the allocation tracker, you must first launch the standalone version of DDMS, which can be found in the tools/
directory of the SDK. The version of DDMS included in the Eclipse plugin does not offer you ability to use the allocation tracker yet.
Once DDMS is running, simply select your application process and then click the Allocation Tracker tab. In the new view, click Start Tracking and then use your application to make it execute the code paths you want to analyze. When you are ready, click Get Allocations. A list of allocated objects will be shown in the first table. By clicking on a line you can see, in the second table, the stack trace that led to the allocation. Not only you will know what type of object was allocated, but also in which thread, in which class, in which file and at which line. The following screenshot shows the allocations performed by Shelves while scrolling a ListView.
Even though it is not necessary, or sometimes not possible, to remove all allocations for your performance critical code paths. the allocation tracker will help you identify important issues in your code. For instance, a common mistake I have seen in many applications is to create a new Paint
object on every draw. Moving the paint into an instance field is a simple fix that helps performance a lot. I highly encourage you to peruse the Android source code to see how we reduce allocations in performance critical code paths. You will also thus discover the APIs Android provide to help you reuse objects.
Note: this article was originally posted on my personal blog.
Wednesday, February 11, 2009
Apps that work together
Android applications can easily be linked together using intents. One example of this involves Shazam, MySpace, and the Amazon MP3 Store. Once Shazam has identified a song, you can also search for the artist's official MySpace profile page or buy the song via via the Amazon MP3 app. Here, the three developers behind these apps talk about how they accomplished this:
To hear more about how the MySpace app for Android was built and lessons learned, watch Matt Kanninen:
http://www.youtube.com/p/3A4E4D83B9614552Tomasz Zawada of Shazam also talks about his opinions on the Android platform and has some tips for developers building Android apps:
http://www.youtube.com/p/A131466774A03834These and the other Android app developer videos can be found here.
Monday, February 9, 2009
Android 1.1 SDK, release 1 Now Available
Hello, developers! As you may have heard by now, users around the world have started to receive updates to their Android devices that provide new features and functionality. You may also have noticed that the new update reports as "Android 1.1". Applications written with the 1.0_r1 and 1.0_r2 SDKs will continue to work just fine on Android 1.1. But if you want to take advantage of the new APIs in 1.1, you'll need an updated SDK.
That's why I'm pleased to let you know that the Android 1.1 SDK, release 1 is now available. As you'll quickly see from the release notes, the actual API changes are quite minor, but useful. This new SDK has all the new APIs, as well as a new emulator image to let you test your applications. If you have a retail device running Android, contact your operator for the update schedule. An updated v1.1 system image for the Android Developer Phone 1 will be coming soon.
In addition to the new APIs, the emulator also contains improved ability to test localizations to the German language. Localizations for other languages will be added in future SDK releases.
You can download the updated SDK using the links above. Happy coding!
Sunday, February 8, 2009
Kampanye Damai Pemilu Indonesia 2009
Kampanye Damai Pemilu Indonesia 2009 sudah memasukin minggu kedua, fluktuasi rangking yang terjadi cukup menegangkan karena silih bergantinya posisi puncan di kontes seo ini. Para master yang tadinya tiarap sudah mulai memuntahkan amunisinya perlahan-lahan. bahkan beberapa veteran Busby SEO Test sepertinya ikut meramaikan kontes seo lokal ini.Posisi 10 besar masih dikuasai blogger-blogger dari Indonesia ... he he he .. emang penyelenggaraannya di Indonesia, akan tetapi ada beberapa peserta kontes yang sekarang sedang berdomisili di Hongkong. Kampanye Damai Pemilu Indonesia 2009 ini tidak hanya digembar-gemborkan oleh para blogger Indonesia, ternyata blogger Hongkong yang berasal dari Indonesia juga ikut meramaikan arena Kampanye Damai.Blog ini tidak berniat ikut partisipasi dalam kontes Kampanye Damai Pemilu akan tetapi ikut nyundul posisi blog utama agar mempunyai balok-balok yang kuat. Mudah-mudahan blog yang masih ber PR o dan baru dibuat beberapa minggu yang lalu ini dapat mengoptimasi blog utama di kontes seo dengan kata Kunci Kampanye Damai Pemilu di Pemilu Indonesia 2009 ini.
Posisi puncak sampai dengan sore ini sepertinya diduduki oleh salah satu master seo, karena postngan di blognya baru ada satu tapi bisa melejit ke posisi no 1, ini menandakan sokongan dan dukungan dari blog-blog pendukungnya lumayan kuat dan membuat posisinya mantap di no.1, kita sama-sama menunggu apakah akan ada perubahan rangking lagi malam ini.Selamat berlomba para peserta Kampanye Pemilu Indonesia 2009.
Thursday, February 5, 2009
SEO company optimized a client's site
Today the industry and contestan seo is highly competitive. Worldwide, there are now thousands of search engine optimization companies. There is also an ever increasing number of websites and many of them are already well optimized, making the competition much worse. In the past, when an SEO company optimized a client's site, most other sites in direct competition were poorly optimized or not optimized at all; the game was easier. But now, almost every competitor of yours is using the services of some SEO to optimize their site for keyword Kampanye Damai Pemilu Indonesia 2009 in contest seo local indonesian.
As you can guess, this makes the game really tough. Also, this leads up to half of the SEO / SEM companies into considering unethical and illegal strategies in order to get their customers to the top of search engine result pages.
Nevertheless, this rarely gives these companies any competitive advantage as most solid and respectable companies seeking SEO services now recognize that guarantees of top-10 rankings sound, at the very least, suspicious. Let's imagine a company called pencuridompetibu-ibusegarcompany LTD has a website that offers some products. Except product advertising, this site does not contain any valuable information for visitors so the search engines do not rank it high. So, pencuridompetibu-ibusegarcompany hires SEO expert to help them with rankings because claims he can get any site into the Top-10 for keyword Kampanye Damai Pemilu Indonesia 2009.
What this SEO expert does is stuff the company pages with irrelevant keywords, creating a link system with thousands of hidden links and then implements some advanced spamming techniques like dynamic page generation and cloaking.
As a result, the rankings of the page are initially boosted. pencuridompetibu-ibusegarcompany is happy and pays the fee to Mr.blablamadeinmatre. Still, visitors coming to the site see even more of a mess than before the "optimization" and they are still unable to find any valuable content. Since they find the pencuridompetibu-ibusegarcompany's site for the irrelevant keywords, that is, not for those they are primarily seeking, the conversion of visitors into customers is very low. As a result, customers are unsatisfied and pencuridompetibu-ibusegarcompany receives huge bills for traffic which hasn't been converted and hasn't brought any real profit.
The search engine which allowed for the spammer's site on top of its listings is also unsatisfied since it's losing its popularity among Web surfers because they are serving irrelevant pages. So it invests money into developing a more advanced spider that finally cracks tricks and the positions of pencuridompetibu-ibusegarcompany fall down. Eventually, pencuridompetibu-ibusegarcompany is excluded from the search engine index entirely because an unsatisfied visitor or a competitor reported to the search engine that pencuridompetibu-ibusegarcompany is using spam methods. Of course, pencuridompetibu-ibusegarcompany is unsatisfied with this situation to get their money refunded. Mr.blablamadeinmatreis unwilling to cooperate or perhaps even managed to escape before all this mess started. The best case scenario is that pencuridompetibu-ibusegarcompany gets its money back but is never able to restore its rankings and has to invest in a new website.
Nobody is satisfied in this story, however such things do happen now and again, even in today's more sophisticated SEO environment. Unfortunately, there's no solution for such cases except abandoning spam techniques entirely and following a Code of Ethics for all Search Engine Optimizers which maintains their good reputation and withstand crowds of unethical SEO companies that wave the banner of illegal yet "effective" promotion strategies. Adhering to a Code of Ethics (or Code of Conduct), if presented properly, may serve as an effective competitive advantage.