This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:gravity="center" > | |
<fragment | |
android:id="@+id/map" | |
android:name="com.google.android.gms.maps.MapFragment" | |
android:layout_width="match_parent" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.reversegeocoding; | |
import java.io.BufferedReader; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.io.UnsupportedEncodingException; | |
import java.net.URLEncoder; | |
import java.util.Locale; | |
import org.apache.http.HttpEntity; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//*****************************************SET these things in Activity*******************************************************// | |
public class MainActivity extends Activity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
AppController appState = ((AppController)getApplicationContext()); | |
//Set the value in application variable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String startDateString = edtTxtDateId.getText().toString(); | |
String newDateString = null; | |
DateFormat df = new SimpleDateFormat("yyyy/mm/dd",Locale.ENGLISH); | |
DateFormat sdf = new SimpleDateFormat("mm/dd/yyyy",Locale.ENGLISH); | |
Date startDate; | |
try { | |
startDate = sdf.parse(startDateString); | |
newDateString = df.format(startDate); | |
System.out.println(newDateString); | |
} catch (ParseException e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UrlConnection { | |
private static final String TAG = "DownloadData"; | |
public static String executeGet(String requestUrl) | |
throws IOException { | |
InputStream inputStream = null; | |
String response=""; | |
HttpURLConnection urlConnection = null; | |
/* forming th java.net.URL object */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.windhyaworks.adapters; | |
import java.util.List; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.ArrayAdapter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String date=jsonobject.getString("needbydate"); | |
DateFormat df = new SimpleDateFormat("MMM/dd/yyyy",Locale.ENGLISH); | |
df.setTimeZone(TimeZone.getTimeZone("UTC")); | |
DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss",Locale.ENGLISH); | |
sdf.setTimeZone(TimeZone.getTimeZone("UTC")); | |
Date startDate; | |
startDate = sdf.parse(date); | |
needbydate = df.format(startDate).toString()+""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.emil.android.util; | |
import android.content.Context; | |
import android.net.ConnectivityManager; | |
import android.net.NetworkInfo; | |
import android.telephony.TelephonyManager; | |
/** | |
* Check device's network connectivity and speed | |
* @author emil http://stackoverflow.com/users/220710/emil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.emil.android.util; | |
import android.content.Context; | |
import android.location.Location; | |
import android.location.LocationListener; | |
import android.location.LocationManager; | |
import android.os.Bundle; | |
import android.util.Log; | |
/** |