1

Android開発は初めてです。画像をロードし、編集して保存し、ブルートゥースと電子メールで画像を転送するアプリケーションを作成しようとしています。

Android には、Bluetooth 機能を簡単に実装するために使用できるツールが組み込まれているようですが、簡単でわかりやすいチュートリアルはまだ見つかりませんでした。

誰かが私を助けて、ブルートゥース機能または電子メール機能に関する優れたチュートリアルへの例またはリンクを教えてもらえますか?

助けてください!

ありがとう

4

2 に答える 2

0

このコードでは、最初にファイルを sdCad に保存してから、Bt、電子メール、または ... で送信します。

    send.setOnClickListener(new OnClickListener() {

    @Override
    public void onClick(View arg0) {
        File newSoundFile = new File("/sdcard/101Ringtone.ogg");
        Uri mUri = Uri.parse("android.resource://" + getPackageName() + "/"+ RingtoneRaw);
        ContentResolver mCr = getContentResolver();
        AssetFileDescriptor soundFile;
        try {
            soundFile= mCr.openAssetFileDescriptor(mUri, "r");
           } catch (FileNotFoundException e) {
               soundFile=null;   
           }

           try {
              byte[] readData = new byte[1024];
              FileInputStream fis = soundFile.createInputStream();
              FileOutputStream fos = new FileOutputStream(newSoundFile);
              int i = fis.read(readData);
              while (i != -1) {
                fos.write(readData, 0, i);
                i = fis.read(readData);
              }
              fos.close();
           } catch (IOException io) {
           }

        Intent i = new Intent(Intent.ACTION_SEND);
        i.setType("audio/ogg");    
        i.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(newSoundFile)); 
        startActivity(Intent.createChooser(i, "Share ringtone via:"));
    }

});
于 2013-07-26T05:27:40.080 に答える
0

この以下のスクリプトを使用してください

Intent sendIntent = new Intent(Intent.ACTION_SEND);
        sendIntent.setType("image/jpeg");
        sendIntent.putExtra(Intent.EXTRA_SUBJECT, "Photo");
        sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:///sdcard/dcim/Camera/filename.jpg"));
        sendIntent.putExtra(Intent.EXTRA_TEXT, "Enjoy the photo");
        startActivity(Intent.createChooser(sendIntent, "Email:"));
于 2013-07-26T05:15:55.137 に答える