Category Archives: Android

Add/Remove items at RunTime in Spinner Android?[Solved]

Step 1: Add the following Code to activity_main.xml Step 2: Add the following code to mainActivity.java Step 3 : Now you can save and execute the Application. Your output will be like this : 2,470 total views, no views today

2,470 total views, no views today

Android secure encrypted SharedPreferences example Tutorial

In Android shared preferences are used to store user’s preferences for android application such as display name, notification settings, vibration on/off etc. But many times, for example if we are developing a game and storing user’s score inside shared preferences then we should not store them directly. Anny rooted phone can be used to directly… Read More »

7,200 total views, 1 views today

Android Alert Dialog Example sample Tutorial

Alert dialog is used in android whenever we need to notify user about certain events in our android application. Such events include exiting of app,deleting some entry, network usage etc. We will see a simple code snippet showing the implementation of alert dialog in android as below: 1,866 total views, no views today

1,866 total views, no views today

Android simple Tabs with Swipe Layout(ViewPager) Fragments Tutorial

In this tutorial we will see a simple example of android application having tabs with swiping screens. Previously we saw an example of just swiping views using ViewPager. Now we will use ActionBar Tabs along with ViewPager in this tutorial. Steps required for implementation: 1) Setting navigation mode of ActionBar to actionBar.NAVIGATION_MODE_TABS and adding tabs.… Read More »

4,605 total views, no views today

Android ViewPager simple Example Tutorial- Sliding Screens

  ViewPager is used to for implementing the Screen Slides. Screen slides are transitions between one entire screen to another and are common with UIs like setup wizards or slideshows as shown in the above video. Steps for implementing ViewPager: 1) A Layout(that contains ViewPager) for the MainActivity. 2) FragmentPagerAdapter/FragmentStatePagerAdapter class which controls the fragments… Read More »

28,307 total views, 1 views today

Simple Android Foreground Service Example Tutorial

In this tutorial we will see a very simple implementation of android foreground service. A Service is an application component that can perform long-running operations in the background and does not provide a user interface. A Foreground Service in android is a background service which keeps running even after the parent application is closed. Use… Read More »

30,282 total views, 5 views today

Android Advanced Interview Questions And Answers

Q)Explain  Service vs intent service ? When to use? The Service can be used in tasks with no UI, but shouldn’t be too long. If you need to perform long tasks, you must use threads within Service. The IntentService can be used in long tasks usually with no communication to Main Thread. If communication is required, can use Main Thread… Read More »

4,591 total views, no views today

Android AsyncTask Example

AysnTask is an inbuilt class in android which can be used for performing background operations like downloading a file, making HTTP Request and then showing the results on the UI. AsyncTask enables proper and easy use of the UI thread. This class allows to perform background operations and publish results on the UI thread without… Read More »

5,154 total views, no views today