One common task for most Android apps is connecting to the Internet. Most network-connected Android apps use HTTP to send and receive data. This article shows you how to write a simple application that connects to the Internet, send HTTP GET request & display the response. . .
Android Design Support Library brings a number of material design components that are compatiable with all Android 2.1 or higher devices. The new componenets are navigation view, TextInputLayout for floating labels for editing text, a floating action button, snackbar, tabs, coordinatorLayout, AppBarLayout & Collapsing Toolbars. In this post we will create an app that follows material design specifications using the new components provided by Design Support Library. .
EditText , has a hint attribute that will show text inside the EditText telling the user what to enter in this text field. That hint text disappears due to the user inputting text. However, TextInputLayout , "a layout wrapping an EditText", shows hint as floating label when the hint is hidden due to the user inputting text. TextInputLayout is part of Design Support library.
In a previous post Android | Check & Enable Location Service , we have seen how to check if the location service is enabled and how to redirect the user to the settings screen where he can enable the location service if it is disabled. Google Play Service 7.0 has introduced a new standard mechanism to check if the necessary location settings are enabled or not. Your app can display a location settings dialog for the user to change their settings without leaving your app.
In a previous post Android | Get Last (Current) Location , we have seen how to get device current location using fused location provider APIs. But, what if the location service is not enabled?! Here we will see how to check if the location service is enabled or not and how to take the user directly to the screen where he can enable it.
In a previous post Android |Get Current Location & Location Updates | Location Services API Tutorial , we have seen how to get current location using older android APIs. Google introduced a new API (fused location provider) to get device location using the Google Play Services. Using the new API, you can request the last known location of the user's device.
"In most cases, you are interested in the user's current location, which is usually equivalent to the last known location of the device. "
A content provider presents data to external applications. Android comes with a number of content providers that store common data such as contact informations, calendar information, and media files, browser history and bookmarks. Here we will use Browser Provider to read default browser “Chrome” history and display the history on a list view.
Android SDK has a large set of standard views such as Button, TextView and ImageView. However, the framework also enables developers to create custom views that meet unique needs for example a pie chart or donut chart. This post is aiming to show you how to create a new simple custom view, how to draw the shape of the view and how to give it a nice look and feel.
Drawing in HTML5 is really interesting you can draw almost everything if you master the tricks of drawing. Here we will draw a donut chart using arc() function then we will give it some artistic effects using gradient color and shadow. You need to know some basic simple math concepts about circle to draw such chart.
This is an interesting post showing how to design an activity screen similar to user profile setting screen in WhatsApp Android app. Tips and tricks covered here are can be very helpful when designing your Android apps.
Here is a sample Java code to generate k-combinations of a set of elements in an array. You just need to pass the array and the k which is an integer that represents the length of the unique subsets you want to generate out of the original array.
In the Web MVC framework, each DispatcherServlet has its own WebApplicationContext, which inherits all the beans already defined in the root WebApplicationContext. So if you have common beans or resources that need to be shared among “child” WebApplicationContexts, you need to define them within root WebApplicationContext.
Location Services API enables you to build location-aware Android application without going into the details of the underlying technologies. Location Services maintains user’s current location so your app just needs to get it from location client. The accuracy of the location depends on the active location sensors and location permissions requested in the Manifest file. Also, the API allows you to get the user’s updated location at regular intervals.
This post shows how to select an image from image gallery, display it on ImageView and how to get its real path on different API versions (19, 17 & 10). We will use ACTION_GET_CONTENT intent that is set to select data of type image only.
Developer Preview support library
. RecyclerView is a more advanced and flexible than ListView This widgets have material design style by default. Use RecyclerView widget when you have lists that change dynamically.
Android L Developer Preview is an early release of the upcoming Android platform. This post shows how to get your development environment ready, how to create a simple app & how to use Material Design theme.