upload image to Picasa using picasawebservice in android

社会主义新天地 提交于 2019-12-14 03:16:21

问题


I am developing Android app which uploads images to Picasa but while authentication i am getting an ClassnotfoundException and some time Unable to execute dex: Java heap space

all Gdata jar files are in Lib folder which includes Guava-11.0.2 file.

Note: I am verifying the application on Android Emulator.

package com.example.temp;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ListView;

import com.google.gdata.client.*;
import com.google.gdata.client.photos.*;

import com.google.gdata.data.*;
import com.google.gdata.data.media.*;
import com.google.gdata.data.photos.*;
import com.google.gdata.util.AuthenticationException;


public class Temp extends Activity implements OnClickListener {

    Button oButton;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_temp);

        oButton = (Button) findViewById(R.id.btnok);


        oButton.setOnClickListener(this);


    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_temp, menu);
        return true;
    }

    public void onClick(View arg0) {
        // TODO Auto-generated method stub
        PicasawebService oPicasaWebService = new PicasawebService("example");
        try {
            oPicasaWebService.setUserCredentials("ashishmchauhan@gmail.com", "qualis");
        } catch (AuthenticationException e) {
            // TODO Auto-generated catch block
            Log.d("Temp",e.getMessage());
            e.printStackTrace();
        }

    }



}

来源:https://stackoverflow.com/questions/12418750/upload-image-to-picasa-using-picasawebservice-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!