Android | Techbirds | Page 4

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,543 total views, no views today

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 →

872 total views, no views today

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 →

682 total views, no views today

In order to get the current date,time,we can use 2 methods-either using the localtime of the desktop or using GMT(GREENWICH MEAN TIME) //USING THE LOCAL TIME time_t time; struct tm * timeinfo; time (&time); timeinfo = localtime (&time); CCLog(“year->%d”,timeinfo->tm_year+1900); CCLog(“month->%d”,timeinfo->tm_mon+1); CCLog(“date->%d”,timeinfo->tm_mday); CCLog(“hour->%d”,timeinfo->tm_hour); CCLog(“minutes->%d”,timeinfo->tm_min); CCLog(“seconds->%d”,timeinfo->tm_sec); //USIMG GMT Replace the above line timeinfo = localtime (&time);withtimeinfo =gmtime

Read More →

4,004 total views, no views today

In order to enable multitouch just go to your AppController.mm. Then in the function didFinishLaunchingWithOptions after creating the EAGL View add the following line. [__glView setMultipleTouchEnabled:YES]; Then the didfinishlaunchingwithoptions will look like: (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. // Add the view controller’s view to the window and

Read More →

4,065 total views, no views today