Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
evDB Informationpublic interface DownloadCallback<T> {
interface Progress {
int ERROR = -1;
int CONNECT_SUCCESS = 0;
int GET_INPUT_STREAM_SUCCESS = 1;
int PROCESS_INPUT_STREAM_IN_PROGRESS = 2;
int PROCESS_INPUT_STREAM_SUCCESS = 3;
}
/**
* Call from main thread to update the UI
* @param result
*/
void updateFromDownload(T result);
/**
* Get the device's active network status as a NetworkInfo object
* @return
*/
NetworkInfo getActiveNetworkInfo();
/**
* Show progress update
* @param progressCode one of the constants defined above
* @param percentComplete 0-100
*/
void onProgressUpdate(int progressCode, int percentComplete);
/**
* Called when process has finished regardless of success of download.
*/
void finishDownloading();
}
public class DummyActivity extends AppCompatActivity implements DownloadCallback {
private NetworkFragment networkFragment;
private boolean downloading = false;
private TextView mTextView2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_dummy);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
mTextView2 = findViewById(R.id.textView2);
networkFragment = NetworkFragment.getInstance(getSupportFragmentManager(), getString(R.string.base_url));
}
@Override
private void updateFromDownload(String result) {
mTextView2.setText(result);
}
private void startDownload() {
if (!downloading && networkFragment != null) {
networkFragment.startDownload();
downloading = true;
}
}
}
