I would like to know if to send the image from java I must first encode it.
JDeveloper's questions
For example, in Samsung mobile devices and tablets I see that the package name for their default browser is com.sec.android.app.sbrowser, I would like to know everyone's because it seems to change depending on the brand.
I want to perform an event when a button is clicked, as if it were checked, and perform another when that button is clicked again.
I have problems with accents and special characters, generating a json with php in the accents, for example:
T\u00c3\u00a9cnologia = Técnologia
I already tried to fix it with mysqli_set_charset($conexion, "utf8");
but nothing.
<?php
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
header('Access-Control-Allow-Headers: Content-Type,x-prototype- version,x-requested-with');
//header("Content-type: application/json; charset=utf-8");
$server = "localhost";
$user = "root";
$pass = "";
$bd = "u703093142_wifi";
//Creamos la conexión
$conexion = mysqli_connect($server, $user, $pass,$bd)
or die("Ha sucedido un error inexperado en la conexion de la base de datos");
//generamos la consulta
$sql = "select upload.*,promociones.nombre_input
from upload
inner join promociones on upload.idGaleria=promociones.imagen_gallery limit 4";
mysqli_set_charset($conexion, "utf8"); //formato de datos utf8
if(!$result = mysqli_query($conexion, $sql)) die();
//$clientes = array(); //creamos un array
/*
while($row = mysqli_fetch_array($result))
{
$titulo=$row['titulo'];
utf8_decode($nombre_input=$row['nombre_input']);
$data[] = array('nombre_input'=> $nombre_input,'titulo'=> $titulo);
}
*/
while($row = mysqli_fetch_assoc($result)){
$data[]=array_map('utf8_encode', $row);
}
$close = mysqli_close($conexion)
or die("Ha sucedido un error inexperado en la desconexion de la base de datos");
//Creamos el JSON
$json_string = json_encode($data);
//echo $json_string;
echo '{"datos":'.$json_string."}";
//Si queremos crear un archivo json, sería de esta forma:
/*
$file = 'clientes.json';
file_put_contents($file, $json_string);
*/
?>
Hello, I have a BroadcastReceiver that returns me
Log.i("Network", "Network connected : " + ni.getTypeName()); WIFI o MOBILE
and another method that returns me in case of being WIFI its
Log.i("Network", "Name " + ssid);
there is a method that must be executed if it ni.getTypeName()
is WIFI
and suddenly changes to MOBILE
and vice versa and if it is in WIFI
and the SSID
changes also execute this method.
I am currently using the accessibility service, but since android lollipop also requires that applications with access be activated Settings->Security->Applications with access-> myApplication
I need encriptar
the IMEI
en MD5
, does anyone know how it would be done? I manage to get the IMEI
but for the encriptación
.
I am using geolocation in android using GPS
and NETWORK
, I have the cycle configured every 2 minutes to send the location, but obviously this consumes a lot of battery, I need some good practice so that the location is constantly sent if the user is not moved.
TrackingModels.positionInfo position = new TrackingModels.positionInfo();
LocationManager locationManager = (LocationManager)ctx.getSystemService(Context.LOCATION_SERVICE);
LocationListener mlocListener = new MyLocationListener();
locationManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, 0, 0, mlocListener);
Location coordinatesGPS = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
Location coordinatesNetwork = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
Location coordinates;