initial commit

This commit is contained in:
xoureldeen 2024-11-06 01:59:57 +02:00
parent 46bb998b2f
commit d5a11700c2
4 changed files with 65 additions and 48 deletions

View file

@ -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