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 TestActivity extends Activity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_sample); | |
if(!isUploading) { | |
// EditText view with file path |
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
LatLngBounds.Builder builder = new LatLngBounds.Builder(); | |
//mMarkers is a List<Marker> with your markers | |
for (Marker marker : mMarkers) { | |
builder.include(marker.getPosition()); | |
} | |
LatLngBounds bounds = builder.build(); | |
CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngBounds(bounds, PADDING); //padding between screen borders and extreme right/left markers |
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
<!-- http://development.server.com/confirmations/eMkVMRppXUbV5F8Xd17W from browser address bar --> | |
<intent-filter> | |
<action android:name="android.intent.action.VIEW" /> | |
<category android:name="android.intent.category.DEFAULT" /> | |
<category android:name="android.intent.category.BROWSABLE" /> | |
<data | |
android:host="development.server.com" | |
android:scheme="http" /> |
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 BadRequestException extends Exception { | |
public BadRequestException() { super(); } | |
public BadRequestException(String message) { super(message); } | |
public BadRequestException(String message, Throwable cause) { super(message, cause); } | |
public BadRequestException(Throwable cause) { super(cause); } | |
} |
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.test.app.widgets; | |
import java.util.ArrayList; | |
import android.content.Context; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Paint; | |
import android.graphics.Path; | |
import android.util.AttributeSet; |
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.test.app; | |
import com.test.app.R; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.util.AttributeSet; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.widget.CompoundButton; |
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 android.content.Context; | |
import android.hardware.Camera; | |
import android.util.Log; | |
import android.view.SurfaceHolder; | |
import android.view.SurfaceView; | |
import java.io.IOException; | |
import java.util.List; | |
public class CameraPreview extends SurfaceView implements SurfaceHolder.Callback { |
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
/// | |
///Your adapter code | |
/// | |
public View getView(int position, View convertView, ViewGroup parent) { | |
//example of usage | |
//let holder.image be some ImageView, mContentUri some video file Uri | |
new VideoThumbnailLoader(getContext(), holder.image, MediaStore.Images.Thumbnails.MICRO_KIND).execute(mContentUri); | |
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
/** | |
* Fetches how many bytes have been downloaded so far and updates ProgressBar | |
*/ | |
class DownloadProgressCounter extends Thread { | |
private final long downloadId; | |
private final DownloadManager.Query query; | |
private Cursor cursor; | |
private int lastBytesDownloadedSoFar; | |
private int totalBytes; |
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
for i in {1..5} | |
do | |
adb shell settings put global airplane_mode_on 1 | |
adb shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true | |
sleep $(( ( RANDOM % 10 ) + 10 )) | |
adb shell settings put global airplane_mode_on 0 | |
adb shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state false | |
sleep $(( ( RANDOM % 10 ) + 10 )) | |
done |
OlderNewer