mirror of
https://github.com/xoureldeen/Vectras-VM-Android.git
synced 2026-05-05 17:56:59 +00:00
initial commit
This commit is contained in:
parent
46bb998b2f
commit
d5a11700c2
4 changed files with 65 additions and 48 deletions
|
|
@ -81,44 +81,7 @@ public class AboutActivity extends AppCompatActivity implements View.OnClickList
|
|||
//AdRequest adRequest = new AdRequest.Builder().build();
|
||||
//mAdView.loadAd(adRequest);
|
||||
VectrasApp.prepareDataForAppConfig(this);
|
||||
new Thread(new Runnable(){
|
||||
|
||||
public void run(){
|
||||
|
||||
BufferedReader reader = null;
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
|
||||
try {
|
||||
// Create a URL for the desired page
|
||||
URL url = new URL(AppConfig.vectrasInfo); //My text file location
|
||||
//First open the connection
|
||||
HttpURLConnection conn=(HttpURLConnection) url.openConnection();
|
||||
conn.setConnectTimeout(60000); // timing out in a minute
|
||||
|
||||
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
|
||||
|
||||
//t=(TextView)findViewById(R.id.TextView1); // ideally do this in onCreate()
|
||||
String str;
|
||||
while ((str = in.readLine()) != null) {
|
||||
builder.append(str);
|
||||
}
|
||||
in.close();
|
||||
} catch (Exception e) {
|
||||
UIUtils.toastLong(AboutActivity.this, "check your internet connection");
|
||||
Log.d("VECTRAS",e.toString());
|
||||
}
|
||||
|
||||
//since we are in background thread, to post results we have to go back to ui thread. do the following for that
|
||||
|
||||
runOnUiThread(new Runnable(){
|
||||
public void run(){
|
||||
appInfo = builder.toString(); // My TextFile has 3 lines
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}).start();
|
||||
FloatingActionButton fab = findViewById(R.id.fab);
|
||||
fab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue