'How to get current weather from android device?

I am developing an app, in this app how can get current weather from its device.

My questions:

  1. How to get current weather from android device? or
  2. How can get current weather free (no use any API), how to access device weather temperature?


Solution 1:[1]

If you want weather info you will need an API but if only some data interest you, you might just want to use the user's phone sensors. Assuming it is equiped which isn't guaranteed. Here is the official documentation of Environment sensors I hope this will help you with your problem.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 vinzee