package com.example.update;
import java.io.File;
import cn.bmob.v3.Bmob;
import cn.bmob.v3.datatype.BmobFile;
import cn.bmob.v3.listener.SaveListener;
import cn.bmob.v3.listener.UploadFileListener;
import android.app.Activity;
import android.os.Bundle;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Bmob.initialize(getApplicationContext(),
"d1026dd94989e416d1a4c92f249b45cd");
File a = new File(
"/storage/emulated/0/Pictures/Screenshots/S41231-093453.jpg");
final BmobFile file = new BmobFile(a);
file.upload(getApplicationContext(), new UploadFileListener() {
@Override
public void onSuccess() {
System.out.println("okkk");
Test test = new Test();
test.setFile(file);
test.save(getApplicationContext());
}
@Override
public void onProgress(Integer arg0) {
// TODO Auto-generated method stub
super.onProgress(arg0);
System.out.println(arg0);
}
@Override
public void onFailure(int arg0, String arg1) {
// TODO Auto-generated method stub
}
});
}
}