Showing posts with label on. Show all posts
Showing posts with label on. Show all posts

Wednesday, October 5, 2016

Ways to save BATTERY POWER on Android

1. Tell the device to only use 2G networks. (Settings » Wireless controls » Mobile networks » Use only 2G networks) If you do not need access to high speed data, or there is no 3G or 4G network where you live, you can tell Android to only use 2G mobile networks. You will still have access to EDGE network data and WiFi if needed.


2. Reduce the brightness of your display. (Settings » Sound & Display » Brightness) Most people can see an Android display quite well with the backlighting feature turned off. Move the slider all the way to the left, then try using the device that way. If you cant see it well in that setting, move the slider to the right only as far as necessary to view the display comfortably. Alternatively, Auto brightness coupled with power saving mode (found on most Samsung, LG, Sony, and some Motorola devices) will conservatively adjust the display to the surroundings to only the brightness necessary.


3. If your device has an AMOLED screen, always use a black background. AMOLED screens can reduce power usage sevenfold by displaying black instead of white or any other color. When searching on your phone you can also use Black Google Mobile at bGoog.com to get standard Google results (including images) all in black .

4. Set your screen timeout to the shortest length possible. (Settings » Sound & display » Screen timeout) This setting tells the device to turn off the screen after the selected period of inactivity. The shorter the period, the less power your display will use. The setting options vary from phone to phone.

5. Use the Power Control widget. (Home screen » Menu » Add » Widgets » Power control) As of Android 1.6, there is a widget that you can place on any one of your home screens that gives you quick control buttons for WiFi, Bluetooth, GPS, Push sync, and screen brightness (three levels). Use this to control your settings and turn them off to save battery power, as stated above. This is a nice easy shortcut.

6. Do not leave applications running when you dont need them. Close them and return to the home screen.

7. Switch of wi-fi, bluetooth, data networks when not in use since they consume battery while searching for signals. 

The top free power management apps available in the google play are :

BATTERY SAVER DU 

BATTERY Dr SAVER



 
Read More..

Sunday, April 6, 2014

Google Maps Android API v2 example detect user touch on GoogleMap and animate to the clicked location

Modify from last eample "Set map type of GoogleMap" to detect user click on GoogleMap, and animate to the user clicked location.

Google Maps Android API v2 example: detect user touch on GoogleMap and animate to the clicked location


To detect user click event on GoogleMap, modify the FragmentActivity implements OnMapClickListener, override onMapClick(LatLng point), and call myMap.setOnMapClickListener(this).

To animated to a specified location, create a new CameraUpdate by calling CameraUpdateFactory.newLatLng(point) method with the specified location. And then call myMap.animateCamera(...) to start animation to the specified location.

package com.example.androidmapsv2;

import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.GoogleMap.OnMapClickListener;
import com.google.android.gms.maps.model.LatLng;

import android.app.AlertDialog;
import android.location.Location;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends FragmentActivity implements OnMapClickListener{

final int RQS_GooglePlayServices = 1;
private GoogleMap myMap;

Location myLocation;
TextView tvLocInfo;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

tvLocInfo = (TextView)findViewById(R.id.locinfo);

FragmentManager myFragmentManager = getSupportFragmentManager();
SupportMapFragment mySupportMapFragment
= (SupportMapFragment)myFragmentManager.findFragmentById(R.id.map);
myMap = mySupportMapFragment.getMap();

myMap.setMyLocationEnabled(true);

myMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);
//myMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
//myMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
//myMap.setMapType(GoogleMap.MAP_TYPE_TERRAIN);

myMap.setOnMapClickListener(this);


}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_legalnotices:
String LicenseInfo = GooglePlayServicesUtil.getOpenSourceSoftwareLicenseInfo(
getApplicationContext());
AlertDialog.Builder LicenseDialog = new AlertDialog.Builder(MainActivity.this);
LicenseDialog.setTitle("Legal Notices");
LicenseDialog.setMessage(LicenseInfo);
LicenseDialog.show();
return true;
}
return super.onOptionsItemSelected(item);
}

@Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();

int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext());

if (resultCode == ConnectionResult.SUCCESS){
Toast.makeText(getApplicationContext(),
"isGooglePlayServicesAvailable SUCCESS",
Toast.LENGTH_LONG).show();
}else{
GooglePlayServicesUtil.getErrorDialog(resultCode, this, RQS_GooglePlayServices);
}

}

@Override
public void onMapClick(LatLng point) {
tvLocInfo.setText(point.toString());
myMap.animateCamera(CameraUpdateFactory.newLatLng(point));
}

}


Modify layout file to add a TextView to display the clicked location.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity" >

<TextView
android:id="@+id/locinfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<fragment
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment"/>

</LinearLayout>


download filesDownload the files.

Next:
- Detect long click on map and add marker


The series:
A simple example using Google Maps Android API v2, step by step.

Read More..

Monday, March 31, 2014

And today I launched my website on a free server

Last summer I worked on my website and one of my wishes was to upload it on a server.
Thanks to a friend I heard about a nice free server (cause I like free things) that supports PHP and MySql databases and I uploaded there.
Ok, but what about this blog? I will still publish articles here, that website will be just an "intro" to this blog and also there Ill publish links to my projects. It was just one of my dreams to create my website from sketches and to publish it on a server...
So HERE it is! And was created with PHP, MySql Databases and just a little bit HTML & CSS! And visit my site: http://23ars.site50.net
Read More..