@@ -68,7 +68,7 @@ import com.qiniu.android.storage.UploadManager;
6868 new UpCompletionHandler () {
6969 @Override
7070 public void complete (String key , ResponseInfo info , JSONObject response ) {
71- Log . i(" qiniu " , info);
71+ LogUtil . i(info);
7272 }
7373 }, null );
7474...
@@ -163,15 +163,15 @@ public class MainActivity extends Activity implements View.OnClickListener {
163163
164164 @Override
165165 public void onClick(View v) {
166- Log .i("qiniutest", "starting......");
166+ LogUtil .i("starting......");
167167 byte[] data=new byte[]{ 0, 1, 2, 3};
168168 //设置上传后文件的key
169169 String upkey = "uploadtest.txt";
170170 uploadManager.put(data, upkey, uptoken, new UpCompletionHandler() {
171171 public void complete(String key, ResponseInfo rinfo, JSONObject response) {
172172 btnUpload.setVisibility(View.INVISIBLE);
173173 String s = key + ", " + rinfo + ", " + response;
174- Log .i("qiniutest", s);
174+ LogUtil .i(s);
175175 textView.setTextSize(10);
176176 String o = textView.getText() + "\r\n\r\n";
177177 //显示上传后文件的url
@@ -243,7 +243,7 @@ public class MainActivity extends Activity {
243243 Recorder recorder = null;
244244 try{
245245 File f = File.createTempFile("qiniu_xxxx", ".tmp");
246- Log .d("qiniu", f.getAbsolutePath().toString());
246+ LogUtil .d(f.getAbsolutePath().toString());
247247 dirPath = f.getParent();
248248 //设置记录断点的文件的路径
249249 recorder = new FileRecorder(dirPath);
@@ -259,7 +259,7 @@ public class MainActivity extends Activity {
259259 // 不必使用url_safe_base64转换,uploadManager内部会处理
260260 // 该返回值可替换为基于key、文件内容、上下文的其它信息生成的文件名
261261 String path = key + "_._" + new StringBuffer(file.getAbsolutePath()).reverse();
262- Log .d("qiniu", path);
262+ LogUtil .d(path);
263263 File f = new File(dirPath1, UrlSafeBase64.encodeToString(path));
264264 BufferedReader reader = null;
265265 try {
@@ -269,7 +269,7 @@ public class MainActivity extends Activity {
269269 try {
270270 while ((tempString = reader.readLine()) != null) {
271271// System.out.println("line " + line + ": " + tempString);
272- Log .d("qiniu", "line " + line + ": " + tempString);
272+ LogUtil .d("line " + line + ": " + tempString);
273273 line++;
274274 }
275275
@@ -341,7 +341,7 @@ public class MainActivity extends Activity {
341341
342342 int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
343343 final String picturePath = cursor.getString(columnIndex);
344- Log .d("PICTUREPATH", picturePath);
344+ LogUtil .d(picturePath);
345345 cursor.close();
346346
347347 imageview.setVisibility(View.VISIBLE);
@@ -358,13 +358,13 @@ public class MainActivity extends Activity {
358358 HashMap<String, String> map = new HashMap<String, String>();
359359 map.put("x:phone", "12345678");
360360
361- Log .d("qiniu", "click upload");
361+ LogUtil .d("click upload");
362362 isCancelled = false;
363363 uploadManager.put(picturePath, null, token,
364364 new UpCompletionHandler() {
365365 public void complete(String key,
366366 ResponseInfo info, JSONObject res) {
367- Log .i("qiniu", key + ",\r\n " + info
367+ LogUtil .i(key + ",\r\n " + info
368368 + ",\r\n " + res);
369369
370370 if(info.isOK()==true){
@@ -374,7 +374,7 @@ public class MainActivity extends Activity {
374374 }, new UploadOptions(map, null, false,
375375 new UpProgressHandler() {
376376 public void progress(String key, double percent){
377- Log .i("qiniu", key + ": " + percent);
377+ LogUtil .i(key + ": " + percent);
378378 progressbar.setVisibility(View.VISIBLE);
379379 int progress = (int)(percent*1000);
380380// Log.d("qiniu", progress+"");
@@ -461,11 +461,11 @@ public class MainActivity extends Activity {
461461 }
462462 @Override
463463 public void onSuccess(int i, Header[] headers, String s) {
464- Log .i(tag, "请求七牛token:"+s);
464+ LogUtil .i("请求七牛token:"+s);
465465 JsonParser jsonParser = new JsonParser();
466466 JsonElement jsonElement =jsonParser.parse(s);
467467 String token = jsonElement.getAsJsonObject().get("uptoken").toString();
468- Log .i(tag, "七牛开始上传"+localPath+"\n"+key+"\n"+token);
468+ LogUtil .i("七牛开始上传"+localPath+"\n"+key+"\n"+token);
469469 if(uploadManager==null)
470470 {
471471 uploadManager = new UploadManager();
@@ -474,15 +474,15 @@ public class MainActivity extends Activity {
474474 new UpProgressHandler() {
475475 @Override
476476 public void progress(String key, double percent) {
477- Log .i(tag, "a 七牛上传progress:"+percent+"\n"+key);
477+ LogUtil .i("a 七牛上传progress:"+percent+"\n"+key);
478478 }
479479 }, null);
480480
481481 //调用uploadManager上传
482482 uploadManager.put(localPath, key, token, new UpCompletionHandler() {
483483 @Override
484484 public void complete(String key, com.qiniu.android.http.ResponseInfo info, JSONObject response) {
485- Log .i(tag, "a 七牛上传complete:"+key + ",\r\n " + info + ",\r\n " + response);
485+ LogUtil .i("a 七牛上传complete:"+key + ",\r\n " + info + ",\r\n " + response);
486486 }
487487 },uploadOptions);
488488 }
@@ -531,15 +531,15 @@ public class MainActivity extends Activity implements View.OnClickListener {
531531
532532 @Override
533533 public void onClick(View v) {
534- Log .i("qiniutest", "starting......");
534+ LogUtil .i("starting......");
535535 byte[] data=new byte[]{ 0, 1, 2, 3, 3, 4, 5, 6,0, 1, 2, 3, 4, 5, 6,0, 1, 2, 3, 4, 5, 6,0, 1, 2, 3, 4, 5, 6,0, 1, 2, 3, 4, 5, 6,0, 1, 2, 3,};
536536
537537 for(int i=0;i<data.length;i++){
538538 String expectKey =UUID.randomUUID().toString();
539539 uploadManager.put(data, expectKey, uptoken, new UpCompletionHandler() {
540540 public void complete(String k, ResponseInfo rinfo, JSONObject response) {
541541 String s = k + ", "+ rinfo + ", " + response;
542- Log .i("qiniutest", s);
542+ LogUtil .i(s);
543543 String key = getKey(k, response);
544544 String o = hint.getText() + "\r\n\r\n";
545545 hint.setText(o + s + "http://xm540.com1.z0.glb.clouddn.com/" + key);
0 commit comments