Posts

Showing posts with the label android

BottomSlider like Uber

Image
I really like uber's Bottom Slider a lot and i want to create a view like that.After searching, I found a great library do it easily. Here is the screenshot of the sample. Step: 1 ====== Add below line to build.gradle file under app folder and sync compile 'com.github.lawloretienne:discreteslider:0.0.9' Credits to the Author of the Library. Etienne Lawlor Github Link  Step: 2 ====== create a layout like below activity_main.xml ============= <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:app= "http://schemas.android.com/apk/res-auto" android:id= "@+id/main_content" android:layout_width= "match_parent" android:layout_height= "match_parent" android:orientation= "vertical" > <FrameLayout android:id= "@+id/container"

Android HttpURLConnection code for GET and POST Methods

package com . infodat . selltis2 ; import android.util.Log ; import com.infodat.selltis2.utils.Constants ; import com.infodat.selltis2.utils.Utils ; import java.io.BufferedInputStream ; import java.io.BufferedReader ; import java.io.BufferedWriter ; import java.io.IOException ; import java.io.InputStream ; import java.io.InputStreamReader ; import java.io.OutputStream ; import java.io.OutputStreamWriter ; import java.io.UnsupportedEncodingException ; import java.net.HttpURLConnection ; import java.net.URL ; import java.net.URLEncoder ; import java.util.HashMap ; import java.util.Map ; import javax.net.ssl.HttpsURLConnection ; public class HttpWebServiceHandlerSample { static String response = null ; public HttpWebServiceHandlerSample () { } /** * Making service call * * @url - url to make request * @method - http request method * @params - http request params */ // Get Request using HttpURLConnection Code

Create Form Programmatically in Android

Image
Step: 1 create a new xml layout with scrollview and LinearLayout . We create child view dynamically through code , added to the LinearLayout. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 <? xml version = "1.0" encoding = "utf-8" ?> < ScrollView xmlns: android = "http://schemas.android.com/apk/res/android" android: id = "@+id/scrollView" android: layout_width = "match_parent" android: layout_height = "match_parent" android: fillViewport = "false" android: scrollbars = "none" android: layout_margin = "16dp" > < LinearLayout android: id = "@+id/layout1" android: layout_width = "match_parent" android: layout_height = "match_parent" android: orientation = "vertical" ></ LinearLayout > </ ScrollView > Step: 2 create new Activity class 1 2 3 4 5 6 7