Advertisement
prosidha

MainActivity

Mar 17th, 2017
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. package tech.prasidha.elegantweather;
  2.  
  3. import android.Manifest;
  4. import android.content.Context;
  5. import android.content.pm.PackageManager;
  6. import android.location.Criteria;
  7. import android.location.Location;
  8. import android.location.LocationManager;
  9. import android.support.v4.app.ActivityCompat;
  10. import android.support.v7.app.AppCompatActivity;
  11. import android.os.Bundle;
  12. import android.util.Log;
  13. import android.widget.TextView;
  14. import android.widget.Toast;
  15.  
  16. public class MainActivity extends AppCompatActivity {
  17.  
  18. static TextView placeTextView;
  19. static TextView tempeartureTextView;
  20. static TextView descriptionTextView;
  21.  
  22.  
  23. @Override
  24. protected void onCreate(Bundle savedInstanceState) {
  25. super.onCreate(savedInstanceState);
  26. setContentView(R.layout.activity_main);
  27.  
  28. placeTextView = (TextView)findViewById(R.id.location);
  29. tempeartureTextView = (TextView)findViewById(R.id.temperature);
  30. descriptionTextView = (TextView)findViewById(R.id.condition);
  31.  
  32.  
  33. String zipCode = "05301";
  34.  
  35. DownloadTask task = new DownloadTask();
  36. task.execute("http://api.openweathermap.org/data/2.5/weather?zip=" + zipCode + ",us&appid=98dc8bfcf9a4db0711b084a759be29c5");
  37. //task.execute("http://samples.openweathermap.org/data/2.5/weather?lat=35&lon=139&appid=98dc8bfcf9a4db0711b084a759be29c5");
  38. //task.execute("http://samples.openweathermap.org/data/2.5/weather?lat=" + String.valueOf(lat) + "&lon=" + String.valueOf(lng) + "&appid=98dc8bfcf9a4db0711b084a759be29c5");
  39.  
  40. Log.i("it made it", "to end of the app");
  41.  
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement