Category : Android Apps

Android Layouts

  Linear Layout A Linear Layout arranges all its children in one direction either vertical or horizontal. this direction is set by using setOrientation() methd in Actiivty or android:orientation in .xml file. See the example. To see the the Attributes and method of Linear Layout visit the page Example: Vertical Linear Layout  

 

Read More →

685 total views, no views today

Tabs + ViewPager swiping

Requirements To implement a Tabs & ViewPager, using fragments on devices running Android 2.1 or higher, you’ll need to include the Android Compatibility library.  In my example, I’m using Compatibility library v4. Step-by-step Define the Tab ViewPager layout Define the PagerAdapter Define the Tab FragmentActivity The Code Complete Source code The Tab ViewPager layout The Tab ViewPager layout (tabs_viewpager_layout.xml) declares a TabHost and

Read More →

1,290 total views, 1 views today

Tabs. The Fragment Way

Requirements To implement a Tabbed, using fragments on devices running Android 2.1 or higher, you’ll need to include theAndroid Compatibility library.  In my example, I’m using Compatibility library v4 Step-by-Step Define TabHost layout Define Tab fragment layouts Define Tab fragments Define main fragment activity The Code Define the TabHost layout The tabbed UI layout consists of

Read More →

684 total views, 1 views today

View Holder for Android

Now we are going to code the smooth scrolling of our Android ListView.   What’s with the ViewHolder pattern? The ViewHolder design pattern enables you to access each list item view without the need for the look up, saving valuable processor cycles. Specifically, it avoids frequent call of findViewById() during ListView scrolling, and that will

Read More →

552 total views, no views today

Android back key enabled in cocos2d-x

How to enable the android back button key in cocos2d-x Step 1. In your .h file which is inheriting CCLayer, write virtual void keyBackClicked(); Step 2. Define this function in your .cpp file void HelloWorld:: keyBackClicked() { //my code } Step 3. In your init() or onEnter method, write this->setKeypadEnabled(true); And you are done.. HAPPY

Read More →

1,707 total views, 1 views today

1 2 3 4 5 6