怎么获取Android手机的出厂日期

怎么获取Android手机的出厂日期,第1张

很抱歉,三星手机/平板电脑的出厂日期通过网络是无法查询的。建议您携带购机发票、包修卡和机器到就近的三星服务中心,由工程师帮助您查询。

目前可通过三星官网查看设备激活日期的型号包括:S9、S9+、W2018、Note8、S8(2017年9月及之后生产的)、C8型号。

查询网址:

>

Time time = new Time("GMT+8");

timesetToNow();

int year = timeyear;

int month = timemonth;

int day = timemonthDay;

int minute = timeminute;

int hour = timehour;

int sec = timesecond;

SharedPreferences sp = getSharedPreferences("guozitv2", ContextMODE_PRIVATE);

SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");

String spilt[] = dfformat(new Date())toString()split("-");

if (Update(spilt)) {

Editor editor = spedit();

editorputInt("year", IntegervalueOf(spilt[0]));

editorputInt("month", IntegervalueOf(spilt[1]));

editorputInt("day", IntegervalueOf(spilt[2]));

editorcommit();

}

public boolean Update(String[] spilt) {

int year = spgetInt("year", 0);

int month = spgetInt("month", 0);

int day = spgetInt("day", 0);

int yearNow = IntegervalueOf(spilt[0]);

int monthNow = IntegervalueOf(spilt[1]);

int dayNow = IntegervalueOf(spilt[2]);

if (year > yearNow) {

return false;

} else if (year < yearNow) {

return true;

} else {

if (month > monthNow) {

return false;

} else if (month < monthNow) {

return true;

} else {

if (day >= dayNow) {

return false;

} else {

return true;

}

}

}

}

数据库中的文件的话,要adb shell进去查看数据库有没有该字段。存储卡上的文件的话,java中没有获取文件创建事件的接口。

一、 从resource中的raw文件夹中获取文件并读取数据(资源文件只能读不能写)

String res = "";

try{

InputStream in = getResources()openRawResource(Rrawbbi);

//在\Test\res\raw\bbitxt,

int length = inavailable();

byte [] buffer = new byte[length];

inread(buffer);

//res = EncodingUtilsgetString(buffer, "UTF-8");

//res = EncodingUtilsgetString(buffer, "UNICODE");

res = EncodingUtilsgetString(buffer, "BIG5");

//依bbitxt的编码类型选择合适的编码,如果不调整会乱码

inclose();

}catch(Exception e){

eprintStackTrace();

}

myTextViewsetText(res);//把得到的内容显示在TextView上

二、 从asset中获取文件并读取数据(资源文件只能读不能写)

String fileName = "yantxt"; //文件名字

String res="";

try{

InputStream in = getResources()getAssets()open(fileName);

// \Test\assets\yantxt这里有这样的文件存在

int length = inavailable();

byte [] buffer = new byte[length];

inread(buffer);

res = EncodingUtilsgetString(buffer, "UTF-8");

}catch(Exception e){

eprintStackTrace();

}

三、 从sdcard中去读文件,首先要把文件通过\android-sdk-windows\tools\adbexe把本地计算机上的文件copy到sdcard上去,adbexe push e:/Ytxt /sdcard/, 不可以用adbexe push e:\Ytxt \sdcard\ 同样: 把仿真器上的文件copy到本地计算机上用: adb pull /data/data/comtt/files/Testtxt e:/

String fileName = "/sdcard/Ytxt";

//也可以用String fileName = "mnt/sdcard/Ytxt";

String res="";

try{

FileInputStream fin = new FileInputStream(fileName);

//FileInputStream fin = openFileInput(fileName);

//用这个就不行了,必须用FileInputStream

int length = finavailable();

byte [] buffer = new byte[length];

finread(buffer);

res = EncodingUtilsgetString(buffer, "UTF-8");

finclose();

}catch(Exception e){

eprintStackTrace();

}

myTextViewsetText(res);

Calendar c = CalendargetInstance();

String[] months = new String[30];

StringBuilder date = new StringBuilder();

String firstday="";

String lastday="";

for (int i = 0; i < 30; i++) {

months[i] = new SimpleDateFormat("yyyyMMdd")format(new Date(

cgetTimeInMillis()));

cadd(CalendarDAY_OF_MONTH, -1);

Logi("AAAAAAAA", "" + months[i]);

if (i == 0) {

lastday=months[i];

}

if (i==monthslength-1) {

firstday=months[i];

}

}

dateappend(firstday);

dateappend("-");

dateappend(lastday);

textsetText(date);

亲测可以!

以上就是关于怎么获取Android手机的出厂日期全部的内容,包括:怎么获取Android手机的出厂日期、android日历控件怎么获得所选日期的单元格的焦点、android 获取当前时间后怎么获取年月日等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/9465011.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-28
下一篇2023-04-28

发表评论

登录后才能评论

评论列表(0条)

    保存