Tech Programming Ideas is one of the best places on the programming for programmers. Learn coding with Tech Programming Ideas tutorials. We are covered android programming, php, yii2 framework, javascript, mysql, vb.net etc.
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
private static final String VIMEO_ACCESS_TOKEN = "access token"; private static final String VIMDEO_ID = "Your video id"; private PlayerView playerView; private SimpleExoPlayer player;
//Release references private boolean playWhenReady = false; //If true the player auto play the media private int currentWindow = 0; private long playbackPosition = 0;
//To play streaming media, you need an ExoPlayer object. //SimpleExoPlayer is a convenient, all-purpose implementation of the ExoPlayer interface. player = new SimpleExoPlayer.Builder(this).build(); playerView.setPlayer(player);
callVimeoAPIRequest();
//Supply the state information you saved in releasePlayer to your player during initialization. player.setPlayWhenReady(playWhenReady); player.seekTo(currentWindow, playbackPosition); player.prepare(); }
Now, we just create anAsyncHttpClient, and then execute a request specifying an anonymous class as a callback:
importcom.loopj.android.http.*;importcz.msebera.android.httpclient.Header;AsyncHttpClientclient=newAsyncHttpClient();RequestParamsparams=newRequestParams();params.put("key","value");params.put("more","data");client.get("http://www.google.com",params,newTextHttpResponseHandler(){@OverridepublicvoidonSuccess(intstatusCode,Header[]headers,Stringres){// called when response HTTP status is "200 OK"}@OverridepublicvoidonFailure(intstatusCode,Header[]headers,Stringres,Throwablet){// called when response HTTP status is "4XX" (eg. 401, 403, 404)}});
This will automatically execute the request asynchronously and fire theonSuccesswhen the response returns a success code andonFailureif the response does not.
Cron is a time-based job scheduling. Cron runs in the background and tasks scheduled with cron, referred to as “cron jobs,” are executed automatically, making cron useful for automating maintenance-related tasks.
Commands
crontab -e : Edit your cron jobs. crontab -l : List the all your cron jobs. crontab -r : Delete the current cron jobs.
The schedule component of the syntax is broken down into 5 different fields, which are written in the following order: