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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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.app.Activity; | |
import android.graphics.Bitmap; | |
import android.graphics.SurfaceTexture; | |
import android.media.MediaPlayer; | |
import android.net.Uri; | |
import android.os.Bundle; | |
import android.os.Environment; | |
import android.util.Log; | |
import android.view.Surface; | |
import android.view.TextureView; |
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
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:id="@+id/LinearLayout1" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical" > | |
<EditText | |
android:id="@+id/editText" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" |
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 rtsp.example.com.rtspsample; | |
import android.app.Activity; | |
import android.net.Uri; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.view.View.OnClickListener; | |
import android.widget.Button; | |
import android.widget.EditText; | |
import android.widget.VideoView; | |
public class MainActivity extends Activity implements OnClickListener { |
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
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:id="@+id/LinearLayout1" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical" > | |
<EditText | |
android:id="@+id/editText" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" |
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
private void storeImage(Bitmap image) { | |
File pictureFile = getOutputMediaFile(); | |
if (pictureFile == null) { | |
Log.d(TAG, | |
"Error creating media file, check storage permissions: ");// e.getMessage()); | |
return; | |
} | |
try { | |
FileOutputStream fos = new FileOutputStream(pictureFile); | |
image.compress(Bitmap.CompressFormat.PNG, 90, fos); |
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
Environment.getExternalStorageDirectory() | |
+ "/Android/data/" | |
+ getApplicationContext().getPackageName() | |
+ "/Files" |
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
/** Create a File for saving an image or video */ | |
private File getOutputMediaFile(){ | |
// To be safe, you should check that the SDCard is mounted | |
// using Environment.getExternalStorageState() before doing this. | |
// p.s: MODIFY THE PATH YOU WANT YOUR IMAGE TO STORE HERE | |
// 嗨嗨如果你想改儲存路徑記得改這邊 | |
// for example, you can just using this way to save image into the root of sdcard | |
// File mediaStorageDir = new File(Environment.getExternalStorageDirectory().toString()); | |
File mediaStorageDir = new File(Environment.getExternalStorageDirectory() | |
+ "/Android/data/" |
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
//rootProject.file(): 取得根目錄中的檔案 | |
def ksFile = rootProject.file('keystore.properties') | |
def props = new Properties(); | |
if (ksFile.canRead()) { | |
props.load(new FileInputStream(ksFile)) | |
if (props != null) { | |
android.signingConfigs.sign.storeFile file(props['KEYSTORE_FILE']) | |
android.signingConfigs.sign.storePassword props['KEYSTORE_PASSWORD'] | |
android.signingConfigs.sign.keyAlias props['KEYSTORE_ALIAS'] | |
android.signingConfigs.sign.keyPassword props['KEYSTORE_ALIAS_PASSWORD'] |
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
/* predefine zoom and rotate */ | |
var zoomScale = 1; | |
var rotate = 0; | |
var videocontrols = (function () { | |
console.log("VIDCONTROL START"); | |
var css = | |
'#video-container{background:#eee;width:480px;height:360px;overflow:hidden;position:relative;}' + | |
'#ideo-container span{font-size:20px;color:#666;display:block;padding:2em;}' + | |
'video{width:480px;height:360px;position:absolute;top:0;left:0;}' + | |
'change button{width:50px;border:none;background:#333;color:wheat;}'; |
OlderNewer