This file contains hidden or 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.gmail.ruan65.learndroidcaching; | |
import android.content.SharedPreferences; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.net.Uri; | |
import android.os.AsyncTask; | |
import android.os.Bundle; | |
import android.os.Environment; | |
import android.preference.PreferenceManager; |
This file contains hidden or 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
import okhttp3.MediaType; | |
import okhttp3.OkHttpClient; | |
import okhttp3.Request; | |
import okhttp3.RequestBody; | |
public static final MediaType JSON | |
= MediaType.parse("application/json; charset=utf-8"); | |
OkHttpClient client = new OkHttpClient(); |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout | |
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:paddingBottom="@dimen/activity_vertical_margin" | |
android:paddingLeft="@dimen/activity_horizontal_margin" | |
android:paddingRight="@dimen/activity_horizontal_margin" | |
android:paddingTop="@dimen/activity_vertical_margin" |
This file contains hidden or 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 premium.app.dashdots; | |
import android.os.Bundle; | |
import android.support.v7.app.AppCompatActivity; | |
import android.text.Editable; | |
import android.text.TextWatcher; | |
import android.view.KeyEvent; | |
import android.view.View; | |
import android.widget.EditText; | |
import android.widget.TextView; |
This file contains hidden or 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
apply plugin: 'com.android.application' | |
android { | |
compileSdkVersion 23 | |
buildToolsVersion "23.0.2" | |
defaultConfig { | |
applicationId "premium.app.dashdots" | |
minSdkVersion 17 | |
targetSdkVersion 23 |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item android:state_enabled="false" | |
android:color="@color/flat_disabled_text"/> | |
<item android:color="@color/flat_normal_text"/> | |
</selector> |
This file contains hidden or 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 static String getDateStringFromMaximoTimeFormat(String datestring) { | |
final String ISO8601DATEFORMAT = "yyyy-MM-dd'T'HH:mm:ss"; | |
Calendar calendar = Calendar.getInstance() ; | |
SimpleDateFormat dateformat = new SimpleDateFormat(ISO8601DATEFORMAT, Locale.getDefault()); | |
try { | |
Date date = dateformat.parse(datestring.substring(0, 19)); | |
date.setHours(date.getHours()-1); | |
calendar.setTime(date); |
This file contains hidden or 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 InMemoryStore { | |
private Map<String, String> locations = new HashMap<>(); | |
public String getLocationByCode(String code) { | |
return locations.get(code); | |
} |
This file contains hidden or 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 void takePhoto(View view) { | |
Intent intCamera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); | |
intCamera.putExtra("android.intent.extras.CAMERA_FACING", 1); | |
if (intCamera.resolveActivity(getPackageManager()) != null) { | |
startActivityForResult(intCamera, Cv.REQUEST_CAMERA); | |
} | |
} |
OlderNewer