Android REST Controller with Simple Cache Control Headers using Retrofit 1.9.0 + OkHttp 2.2.0
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 videourl = "http://something.com/blah.mp4"; | |
Uri uri = Uri.parse(videourl); | |
Intent intent = new Intent(Intent.ACTION_VIEW, uri); | |
intent.setDataAndType(uri, "video/mp4"); | |
startActivity(intent); |
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
videoView = (VideoView)findViewById(R.id.VideoView); | |
videoView.setVideoPath("/sdcard/blonde_secretary.3gp"); | |
videoView.start(); |
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
Standard definition (Low quality) | |
Video codec - H.264 | |
Video resolution - 176 x 144 px | |
Video frame rate - 12 fps | |
Video bitrate - 56 Kbps | |
Audio codec - AAC-LC | |
Audio channels - (mono) | |
Audio bitrate - 24 Kbps | |
Standard definition (High quality) |
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
wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); | |
params1 = new WindowManager.LayoutParams( | |
LayoutParams.MATCH_PARENT, | |
LayoutParams.MATCH_PARENT, | |
WindowManager.LayoutParams.TYPE_SYSTEM_ALERT | | |
WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY, | |
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | | |
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, | |
PixelFormat.TRANSPARENT); |
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
OkHttpClient client = new OkHttpClient(); | |
Proxy proxy = new Proxy(Proxy.Type.HTTP, InetSocketAddress.createUnresolved("192.168.1.105", 8081); | |
client.setProxy(proxy); |
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
OkHttpClient okHttpClient = new OkHttpClient(); | |
okHttpClient.interceptors().add(mRefreshAndRetryInterceptor); | |
mRestAdapter = new RestAdapter.Builder() | |
... | |
.setClient(new OkClient(okHttpClient)) | |
.build(); | |
private final Interceptor mRefreshAndRetryInterceptor = new Interceptor() { |
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
import android.databinding.BaseObservable; | |
import android.databinding.BindingAdapter; | |
import android.databinding.BindingConversion; | |
import android.text.Editable; | |
import android.text.TextWatcher; | |
import android.widget.EditText; | |
import java.io.Serializable; |
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 LangUtils { | |
public static <K,V> ArrayList<V> getOrCreateArrayList(HashMap<K, ArrayList<V>> hashMap, K key) { | |
ArrayList<V> list = hashMap.get(key); | |
if (list == null) { | |
list = new ArrayList<V>(); | |
hashMap.put(key, list); | |
} | |
return list; | |
} |
##Chai Expect
##Language Chains
- to
- be
- been
- is
- that
- and
- have