The articles have links to an affiliate or partnership websites which allow making money online from the affiliate activities. The easiest and fastest way to start an internet business and make money online is with these programs. The Amazon Associates is the excellent example program if you are an entrepreneur. If you want to participate in the affiliate program to make money online but have financial problems, nevertheless, there are many costless approaches allowing you to earn commissions and to make money online.ConclusionMake money online surveys is focused on order, meal and book which contains all of the free online paid survey make money fast at home because make money online business is the same as make money online business or again heat and label or toy sometime have as a result of make money online business sometime information and label. Anybody that promises you an easy, effortless way to make money online is not telling the truth. So today, the most common way used these days to make money online is affiliate marketing.And one of the easiest and simplest ways to make money online is to go into affiliate or online network marketing programs or build up your own one. And for you to remember, the key to make money online is knowing how and where to start. For more information about make money online, make sure you follow the link in the recourse box below now.
Thursday, March 5, 2009
The Tips for Making Money Online – The Last Part
The articles have links to an affiliate or partnership websites which allow making money online from the affiliate activities. The easiest and fastest way to start an internet business and make money online is with these programs. The Amazon Associates is the excellent example program if you are an entrepreneur. If you want to participate in the affiliate program to make money online but have financial problems, nevertheless, there are many costless approaches allowing you to earn commissions and to make money online.ConclusionMake money online surveys is focused on order, meal and book which contains all of the free online paid survey make money fast at home because make money online business is the same as make money online business or again heat and label or toy sometime have as a result of make money online business sometime information and label. Anybody that promises you an easy, effortless way to make money online is not telling the truth. So today, the most common way used these days to make money online is affiliate marketing.And one of the easiest and simplest ways to make money online is to go into affiliate or online network marketing programs or build up your own one. And for you to remember, the key to make money online is knowing how and where to start. For more information about make money online, make sure you follow the link in the recourse box below now.
Tuesday, March 3, 2009
Android Layout Tricks #3: Optimize by merging
In the previous installment of Android Layout Tricks, I showed you how to use the <include />
tag in XML layout to reuse and share your layout code. I also mentioned the <merge />
and it's now time to learn how to use it.
The <merge />
was created for the purpose of optimizing Android layouts by reducing the number of levels in view trees. It's easier to understand the problem this tag solves by looking at an example. The following XML layout declares a layout that shows an image with its title on top of it. The structure is fairly simple; a FrameLayout is used to stack a TextView on top of an ImageView:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="center"
android:src="@drawable/golden_gate" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dip"
android:layout_gravity="center_horizontal|bottom"
android:padding="12dip"
android:background="#AA000000"
android:textColor="#ffffffff"
android:text="Golden Gate" />
</FrameLayout>
This layout renders nicely as we expected and nothing seems wrong with this layout:
Things get more interesting when you inspect the result with HierarchyViewer. If you look closely at the resulting tree you will notice that the FrameLayout
defined in our XML file (highlighted in blue below) is the sole child of another FrameLayout
:
Since our FrameLayout
has the same dimension as its parent, by the virtue of using the fill_parent
constraints, and does not define any background, extra padding or a gravity, it is totally useless. We only made the UI more complex for no good reason. But how could we get rid of this FrameLayout
? After all, XML documents require a root tag and tags in XML layouts always represent view instances.
That's where the <merge />
tag comes in handy. When the LayoutInflater encounters this tag, it skips it and adds the <merge />
children to the <merge />
parent. Confused? Let's rewrite our previous XML layout by replacing the FrameLayout
with <merge />
:
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="center"
android:src="@drawable/golden_gate" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dip"
android:layout_gravity="center_horizontal|bottom"
android:padding="12dip"
android:background="#AA000000"
android:textColor="#ffffffff"
android:text="Golden Gate" />
</merge>
With this new version, both the TextView
and the ImageView
will be added directly to the top-level FrameLayout
. The result will be visually the same but the view hierarchy is simpler:
Obviously, using <merge />
works in this case because the parent of an activity's content view is always a FrameLayout
. You could not apply this trick if your layout was using a LinearLayout
as its root tag for instance. The <merge />
can be useful in other situations though. For instance, it works perfectly when combined with the <include />
tag. You can also use <merge />
when you create a custom composite view. Let's see how we can use this tag to create a new view called OkCancelBar
which simply shows two buttons with customizable labels. You can also download the complete source code of this example. Here is the XML used to display this custom view on top of an image:
<merge
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:okCancelBar="http://schemas.android.com/apk/res/com.example.android.merge">
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="center"
android:src="@drawable/golden_gate" />
<com.example.android.merge.OkCancelBar
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:paddingTop="8dip"
android:gravity="center_horizontal"
android:background="#AA000000"
okCancelBar:okLabel="Save"
okCancelBar:cancelLabel="Don't save" />
</merge>
This new layout produces the following result on a device:
The source code of OkCancelBar
is very simple because the two buttons are defined in an external XML file, loaded using a LayoutInflate
. As you can see in the following snippet, the XML layout R.layout.okcancelbar
is inflated with the OkCancelBar
as the parent:
public class OkCancelBar extends LinearLayout {
public OkCancelBar(Context context, AttributeSet attrs) {
super(context, attrs);
setOrientation(HORIZONTAL);
setGravity(Gravity.CENTER);
setWeightSum(1.0f);
LayoutInflater.from(context).inflate(R.layout.okcancelbar, this, true);
TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.OkCancelBar, 0, 0);
String text = array.getString(R.styleable.OkCancelBar_okLabel);
if (text == null) text = "Ok";
((Button) findViewById(R.id.okcancelbar_ok)).setText(text);
text = array.getString(R.styleable.OkCancelBar_cancelLabel);
if (text == null) text = "Cancel";
((Button) findViewById(R.id.okcancelbar_cancel)).setText(text);
array.recycle();
}
}
The two buttons are defined in the following XML layout. As you can see, we use the <merge />
tag to add the two buttons directly to the OkCancelBar
. Each button is included from the same external XML layout file to make them easier to maintain; we simply override their id:
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<include
layout="@layout/okcancelbar_button"
android:id="@+id/okcancelbar_ok" />
<include
layout="@layout/okcancelbar_button"
android:id="@+id/okcancelbar_cancel" />
</merge>
We have created a flexible and easy to maintain custom view that generates an efficient view hierarchy:
The <merge />
tag is extremely useful and can do wonders in your code. However, it suffers from a couple of limitation:
<merge />
can only be used as the root tag of an XML layout- When inflating a layout starting with a
<merge />
, you must specify a parentViewGroup
and you must setattachToRoot
totrue
(see the documentation of the inflate() method)
In the next installment of Android Layout Tricks you will learn about ViewStub
, a powerful variation of <include />
that can help you further optimize your layouts without sacrificing features.
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.