当前位置: 首页>>代码示例>>Java>>正文


Java PostResponseAsyncTask类代码示例

本文整理汇总了Java中com.kosalgeek.genasync12.PostResponseAsyncTask的典型用法代码示例。如果您正苦于以下问题:Java PostResponseAsyncTask类的具体用法?Java PostResponseAsyncTask怎么用?Java PostResponseAsyncTask使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PostResponseAsyncTask类属于com.kosalgeek.genasync12包,在下文中一共展示了PostResponseAsyncTask类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onActivityResult

import com.kosalgeek.genasync12.PostResponseAsyncTask; //导入依赖的package包/类
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == CAMERA_REQUEST && resultCode == Activity.RESULT_OK) {
        photo = (Bitmap) data.getExtras().get("data");


        ByteArrayOutputStream baos=new  ByteArrayOutputStream();
        photo.compress(Bitmap.CompressFormat.PNG,100, baos);
        byte [] b=baos.toByteArray();
        temp=Base64.encodeToString(b, Base64.DEFAULT);

        String url = "http://192.168.4.152:5000/connect/";

        HashMap postData = new HashMap();
        postData.put("image", temp);
        PostResponseAsyncTask readTask = new PostResponseAsyncTask(MainActivity.this, postData, new AsyncResponse() {
            @Override
            public void processFinish(String s) {

                if (s.equals("error")){

                    Intent i = new Intent(MainActivity.this,AddPerson.class);
                    i.putExtra("pic",temp);
                    startActivity(i);

                }else{
                    Intent intent = new Intent(MainActivity.this,Profile.class);
                    intent.putExtra("profileDetails",s);
                    startActivity(intent);
                }


            }
        });
        readTask.execute(url);

    }
}
 
开发者ID:encipherers,项目名称:NoZimers,代码行数:38,代码来源:MainActivity.java

示例2: onCreate

import com.kosalgeek.genasync12.PostResponseAsyncTask; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_geo_location);


    String url = "http://192.168.4.152:5000/alert/";

    HashMap postData = new HashMap();

    PostResponseAsyncTask readTask = new PostResponseAsyncTask(GeoLocation.this, postData, new AsyncResponse() {
        @Override
        public void processFinish(String s) {


        }
    });
    readTask.execute(url);



}
 
开发者ID:encipherers,项目名称:NoZimers,代码行数:23,代码来源:GeoLocation.java

示例3: onCreate

import com.kosalgeek.genasync12.PostResponseAsyncTask; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_add_person);

    naam = (EditText)findViewById(R.id.nishant);
    livesIn = (EditText)findViewById(R.id.livesIn);
    age = (EditText)findViewById(R.id.age);
    place = (EditText)findViewById(R.id.PlaceOfMeeting);
    time = (EditText)findViewById(R.id.Time);
    relation = (EditText)findViewById(R.id.Relation);
    notes = (EditText)findViewById(R.id.Notes);
    submit = (Button)findViewById(R.id.submit);


    String currentDateTimeString = DateFormat.getDateTimeInstance().format(new Date());
    // textView is the TextView view that should display it

    time.setText(currentDateTimeString);


    temp = getIntent().getStringExtra("pic");


    submit.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            naamm = naam.getText().toString();
            livee = livesIn.getText().toString();
            agee = age.getText().toString();
            placee = place.getText().toString();
            timee = time.getText().toString();
            relationn = relation.getText().toString();
            notess = notes.getText().toString();


            HashMap postData = new HashMap();
            postData.put("image", temp);
            postData.put("name",naamm);
            postData.put("livesIn",livee);
            postData.put("age",agee);
            postData.put("placeOfMeeting",placee);
            postData.put("timeOfMeeting",timee);
            postData.put("relation",relationn);
            postData.put("notes",notess);

            String url = "http://192.168.4.152:5000/saveprofile/";


            PostResponseAsyncTask readTask = new PostResponseAsyncTask(AddPerson.this, postData, new AsyncResponse() {
                @Override
                public void processFinish(String s) {

                    Intent i = new Intent(AddPerson.this,MainActivity.class);
                    startActivity(i);
                    finish();

                }
            });
            readTask.execute(url);

        }
    });









}
 
开发者ID:encipherers,项目名称:NoZimers,代码行数:75,代码来源:AddPerson.java


注:本文中的com.kosalgeek.genasync12.PostResponseAsyncTask类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。