I want to create android app that while i am in my wifi area it will use the wifi soon as "MyWifi" is not in reach should change and start data connection through 3g/4g...so my question is how to make the application to run 24/7 and drain less as possible battery, also if anyone can givme something about wifi and data connection what are the system calls, or refer me to any tutorials od examples that think that i will find them handy< Thanks
You will not want to let your app "run" 24/7, because that will cause the device to never go to sleep and therefore drain the battery in a way that is usually not acceptable.
You can easily catch an broadcast of the state change of your wifi connection. For an example you can look here
If you want your app to be running 24/7, is it to react to some events? Because you can usually catch any event with BroadCast-Receivers or Intents. In most scenarios this is the way to go.