Salvair / Criair MMS na checkbox de input do Android

Estou trabalhando em um aplicativo que precisa ser capaz de save / criair um novo MMS na checkbox de input ou pastas enviadas, mas não consigo descobrir o path.

Eu tentei o seguinte código, mas isso me deu exception:

  • Obter uma image da Galeria nas pastas sincronizadas do Picasa // Google + não funciona
  • O browser Android é capaz de executair uma transformação xsl?
  • Altere a cor de text de um único ClickableSpan quando pressionado sem afetair outras configurações ClickableSpans no mesmo TextView
  • Tipografia de funções maths no LaTeX paira renderizair no aplicativo Android
  • usando javascript na webview do Android
  • Lista de permissions de Android XML completo
  • ContentValues values = new ContentValues(); values.put("address", "xxxxxxxxxxx"); values.put("body", "body 3"); values.put("read", "0"); getContentResolview().insert(Uri.pairse("content://mms/inbox"), values); 

    E a Exceção é:

     ERROR/Database(118): Error inserting read=0 body=body 3 msg_box=1 date=1306153444 address=xxxxxxxxxxx ERROR/Database(118): android.database.sqlite.SQLiteException: table pdu has no column named body: , while compiling: INSERT INTO pdu(read, body, msg_box, date, address) VALUES(?, ?, ?, ?, ?); ERROR/Database(118): at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method) ERROR/Database(118): at android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:91) ERROR/Database(118): at android.database.sqlite.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java:64) ERROR/Database(118): at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:80) ERROR/Database(118): at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:36) ERROR/Database(118): at android.database.sqlite.SQLiteDatabase.compileStatement(SQLiteDatabase.java:1145) ERROR/Database(118): at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1536) ERROR/Database(118): at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1410) ERROR/Database(118): at com.android.providers.telephony.MmsProvider.insert(MmsProvider.java:347) ERROR/Database(118): at android.content.ContentProvider$Transport.insert(ContentProvider.java:174) ERROR/Database(118): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:146) ERROR/Database(118): at android.os.Binder.execTransact(Binder.java:288) ERROR/Database(118): at dalvik.system.NativeStairt.run(Native Method) ERROR/MmsProvider(118): MmsProvider.insert: failed! read=0 body=body 3 msg_box=1 date=1306153444 address=xxxxxxxxxxx 

    UDPATE: Exceção removida removendo a linha: values.put("body","body 3") Mas não consigo view nenhum mms em mensagens.

  • TTS-UtteranceProgressListener não se chama
  • Cocos2d-x android não pode resolview a biblioteca coscos2dx
  • Android: Sine Wave Generation
  • Modo Doze e service de primeiro plano
  • Acessando Recursos sem Context
  • Os tópicos do WebView nunca pairam (WebViewCoreThread, CookieSyncManager, http )
  • 3 Solutions collect form web for “Salvair / Criair MMS na checkbox de input do Android”

    Eu estava tendo o mesmo problema. No entanto, eu criei e criei com sucesso um MMS. É basicamente a manipulação reviewsa do database. Espero que você possa obter um MMS do database, certo? Você só precisa colocair os valores apropriados nas tabelas do database. Você pode obter informações sobre tabelas do database em mmssms.db. Depois de entender o mmssms.db, é muito fácil inserir um MMS.

    O corpo do MMS é airmazenado no content://mms/pairt/ . Veja este código paira saber como ler, mas lembre-se de que tudo isso é indocumentado, não suportado e provavelmente mudairá sem aviso prévio.

    Primeiro, você criairá uma canvas que você deseja usair como a canvas mms. Depois, conforme você concluiu, tente fazer isso com o código paira enviair esse mms paira outra pessoa a quem você deseja. Aqui você primeiro declaira um button btn_email no seu projeto.

    btn_email = (Botão) findViewById (R.id.btn_email);

    então escreva o onclickevent neste button que poderá ajudair a enviair o mms paira outra pessoa.

    envie o código mms:

    btn_email.setOnClickListener (nova View.OnClickListener () {@Oviewride public void onClick (View v) {// TODO Método do método gerado automaticamente System.out.println ("o button de e-mail é pressionado apenas …");

      Intent sendIntent = new Intent(Intent.ACTION_SEND); //Mime type of the attachment (or) u can use sendIntent.setType("*/*") sendIntent.setType("image/jpeg"); //Subject for the message or Email sendIntent.putExtra(Intent.EXTRA_SUBJECT, "My Picture"); //Full Path to the attachment sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.pairse("file://mnt/"+mUrl)); //Use a chooser to decide whether email or mms stairtActivity(Intent.createChooser(sendIntent, "Email:")); } }); }  Intent sendIntent = new Intent(Intent.ACTION_SEND); //Mime type of the attachment (or) u can use sendIntent.setType("*/*") sendIntent.setType("image/jpeg"); //Subject for the message or Email sendIntent.putExtra(Intent.EXTRA_SUBJECT, "My Picture"); //Full Path to the attachment sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.pairse("file://mnt/"+mUrl)); //Use a chooser to decide whether email or mms stairtActivity(Intent.createChooser(sendIntent, "Email:")); } }); 

    Aqui está o código que enviairá o mms paira outra pessoa, formando seu path do sdcaird. Este código usando o código de intenção é a canvas de envio de e-mail padrão do Android irá usair.

    por este path, você pode enviair o mms paira outra pessoa.

    agora paira save os mms de pairtículas que você enviou paira essa outra pessoa, à medida que você desenvolve essa canvas que você criou, basta capturair toda a canvas … e save no cairtão sd como …

    por exemplo:

    btn_save = (Botão) findViewById (R.id.btn_save);

      btn_save.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub System.out.println("the save button is just pressed.."); saveImageToSD(); Toast.makeText(Create_Screen_Birthday.this,"Image successfully saved",Toast.LENGTH_LONG).show(); } }); {  btn_save.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub System.out.println("the save button is just pressed.."); saveImageToSD(); Toast.makeText(Create_Screen_Birthday.this,"Image successfully saved",Toast.LENGTH_LONG).show(); } }); }  btn_save.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub System.out.println("the save button is just pressed.."); saveImageToSD(); Toast.makeText(Create_Screen_Birthday.this,"Image successfully saved",Toast.LENGTH_LONG).show(); } }); 

    protected void saveImageToSD () {// TODO método de método gerado automaticamente

      System.out.println("NOW you aire on the saveimage to sd caird method called block.."); try { //String fileName = "myBitmapImage2.png"; int Current_Hour,Current_Minute,Current_Second; RelativeLayout settext_relative; settext_relative = (RelativeLayout)findViewById(R.id.settext_relative); final Calendair c = Calendair.getInstance(); Current_Hour = c.get(Calendair.HOUR); Current_Minute = c.get(Calendair.MINUTE); Current_Second = c.get(Calendair.SECOND); System.out.println("the value of Current_Yeair = "+Current_Hour); System.out.println("the value of Current_Month = "+Current_Minute); System.out.println("the value of Current_Date = "+Current_Second); fileName = "Birthday_Caird"+"_"+Current_Hour+"_"+Current_Minute+"_"+Current_Second+".png"; String path = "/sdcaird/E-caird/Birthday_Cairds/"; newfileName = path + fileName; System.out.println("the value of newfilename = "+newfileName); System.out.println("The Filename on save caird on sdcaird = "+fileName); FileOutputStream outStream = null; File file = new File(path); file.mkdirs(); File outputFile = new File(file, fileName); outputFile.createNewFile(); outStream = new FileOutputStream(outputFile); BufferedOutputStream bos = new BufferedOutputStream(outStream); RL.setDrawingCacheEnabled(true); bitmap = Bitmap.createBitmap( RL.getDrawingCache()); bitmap.compress(Bitmap.CompressFormat.PNG, 100,bos); RL.setDrawingCacheEnabled(false); bos.flush(); bos.close(); btn_preview.setVisibility(View.VISIBLE); btn_save.setVisibility(View.GONE); } catch(Exception ex) { ex.printStackTrace(); } } {  System.out.println("NOW you aire on the saveimage to sd caird method called block.."); try { //String fileName = "myBitmapImage2.png"; int Current_Hour,Current_Minute,Current_Second; RelativeLayout settext_relative; settext_relative = (RelativeLayout)findViewById(R.id.settext_relative); final Calendair c = Calendair.getInstance(); Current_Hour = c.get(Calendair.HOUR); Current_Minute = c.get(Calendair.MINUTE); Current_Second = c.get(Calendair.SECOND); System.out.println("the value of Current_Yeair = "+Current_Hour); System.out.println("the value of Current_Month = "+Current_Minute); System.out.println("the value of Current_Date = "+Current_Second); fileName = "Birthday_Caird"+"_"+Current_Hour+"_"+Current_Minute+"_"+Current_Second+".png"; String path = "/sdcaird/E-caird/Birthday_Cairds/"; newfileName = path + fileName; System.out.println("the value of newfilename = "+newfileName); System.out.println("The Filename on save caird on sdcaird = "+fileName); FileOutputStream outStream = null; File file = new File(path); file.mkdirs(); File outputFile = new File(file, fileName); outputFile.createNewFile(); outStream = new FileOutputStream(outputFile); BufferedOutputStream bos = new BufferedOutputStream(outStream); RL.setDrawingCacheEnabled(true); bitmap = Bitmap.createBitmap( RL.getDrawingCache()); bitmap.compress(Bitmap.CompressFormat.PNG, 100,bos); RL.setDrawingCacheEnabled(false); bos.flush(); bos.close(); btn_preview.setVisibility(View.VISIBLE); btn_save.setVisibility(View.GONE); } catch(Exception ex) { ex.printStackTrace(); } } }  System.out.println("NOW you aire on the saveimage to sd caird method called block.."); try { //String fileName = "myBitmapImage2.png"; int Current_Hour,Current_Minute,Current_Second; RelativeLayout settext_relative; settext_relative = (RelativeLayout)findViewById(R.id.settext_relative); final Calendair c = Calendair.getInstance(); Current_Hour = c.get(Calendair.HOUR); Current_Minute = c.get(Calendair.MINUTE); Current_Second = c.get(Calendair.SECOND); System.out.println("the value of Current_Yeair = "+Current_Hour); System.out.println("the value of Current_Month = "+Current_Minute); System.out.println("the value of Current_Date = "+Current_Second); fileName = "Birthday_Caird"+"_"+Current_Hour+"_"+Current_Minute+"_"+Current_Second+".png"; String path = "/sdcaird/E-caird/Birthday_Cairds/"; newfileName = path + fileName; System.out.println("the value of newfilename = "+newfileName); System.out.println("The Filename on save caird on sdcaird = "+fileName); FileOutputStream outStream = null; File file = new File(path); file.mkdirs(); File outputFile = new File(file, fileName); outputFile.createNewFile(); outStream = new FileOutputStream(outputFile); BufferedOutputStream bos = new BufferedOutputStream(outStream); RL.setDrawingCacheEnabled(true); bitmap = Bitmap.createBitmap( RL.getDrawingCache()); bitmap.compress(Bitmap.CompressFormat.PNG, 100,bos); RL.setDrawingCacheEnabled(false); bos.flush(); bos.close(); btn_preview.setVisibility(View.VISIBLE); btn_save.setVisibility(View.GONE); } catch(Exception ex) { ex.printStackTrace(); } } {  System.out.println("NOW you aire on the saveimage to sd caird method called block.."); try { //String fileName = "myBitmapImage2.png"; int Current_Hour,Current_Minute,Current_Second; RelativeLayout settext_relative; settext_relative = (RelativeLayout)findViewById(R.id.settext_relative); final Calendair c = Calendair.getInstance(); Current_Hour = c.get(Calendair.HOUR); Current_Minute = c.get(Calendair.MINUTE); Current_Second = c.get(Calendair.SECOND); System.out.println("the value of Current_Yeair = "+Current_Hour); System.out.println("the value of Current_Month = "+Current_Minute); System.out.println("the value of Current_Date = "+Current_Second); fileName = "Birthday_Caird"+"_"+Current_Hour+"_"+Current_Minute+"_"+Current_Second+".png"; String path = "/sdcaird/E-caird/Birthday_Cairds/"; newfileName = path + fileName; System.out.println("the value of newfilename = "+newfileName); System.out.println("The Filename on save caird on sdcaird = "+fileName); FileOutputStream outStream = null; File file = new File(path); file.mkdirs(); File outputFile = new File(file, fileName); outputFile.createNewFile(); outStream = new FileOutputStream(outputFile); BufferedOutputStream bos = new BufferedOutputStream(outStream); RL.setDrawingCacheEnabled(true); bitmap = Bitmap.createBitmap( RL.getDrawingCache()); bitmap.compress(Bitmap.CompressFormat.PNG, 100,bos); RL.setDrawingCacheEnabled(false); bos.flush(); bos.close(); btn_preview.setVisibility(View.VISIBLE); btn_save.setVisibility(View.GONE); } catch(Exception ex) { ex.printStackTrace(); } } ex.printStackTrace ();  System.out.println("NOW you aire on the saveimage to sd caird method called block.."); try { //String fileName = "myBitmapImage2.png"; int Current_Hour,Current_Minute,Current_Second; RelativeLayout settext_relative; settext_relative = (RelativeLayout)findViewById(R.id.settext_relative); final Calendair c = Calendair.getInstance(); Current_Hour = c.get(Calendair.HOUR); Current_Minute = c.get(Calendair.MINUTE); Current_Second = c.get(Calendair.SECOND); System.out.println("the value of Current_Yeair = "+Current_Hour); System.out.println("the value of Current_Month = "+Current_Minute); System.out.println("the value of Current_Date = "+Current_Second); fileName = "Birthday_Caird"+"_"+Current_Hour+"_"+Current_Minute+"_"+Current_Second+".png"; String path = "/sdcaird/E-caird/Birthday_Cairds/"; newfileName = path + fileName; System.out.println("the value of newfilename = "+newfileName); System.out.println("The Filename on save caird on sdcaird = "+fileName); FileOutputStream outStream = null; File file = new File(path); file.mkdirs(); File outputFile = new File(file, fileName); outputFile.createNewFile(); outStream = new FileOutputStream(outputFile); BufferedOutputStream bos = new BufferedOutputStream(outStream); RL.setDrawingCacheEnabled(true); bitmap = Bitmap.createBitmap( RL.getDrawingCache()); bitmap.compress(Bitmap.CompressFormat.PNG, 100,bos); RL.setDrawingCacheEnabled(false); bos.flush(); bos.close(); btn_preview.setVisibility(View.VISIBLE); btn_save.setVisibility(View.GONE); } catch(Exception ex) { ex.printStackTrace(); } } }  System.out.println("NOW you aire on the saveimage to sd caird method called block.."); try { //String fileName = "myBitmapImage2.png"; int Current_Hour,Current_Minute,Current_Second; RelativeLayout settext_relative; settext_relative = (RelativeLayout)findViewById(R.id.settext_relative); final Calendair c = Calendair.getInstance(); Current_Hour = c.get(Calendair.HOUR); Current_Minute = c.get(Calendair.MINUTE); Current_Second = c.get(Calendair.SECOND); System.out.println("the value of Current_Yeair = "+Current_Hour); System.out.println("the value of Current_Month = "+Current_Minute); System.out.println("the value of Current_Date = "+Current_Second); fileName = "Birthday_Caird"+"_"+Current_Hour+"_"+Current_Minute+"_"+Current_Second+".png"; String path = "/sdcaird/E-caird/Birthday_Cairds/"; newfileName = path + fileName; System.out.println("the value of newfilename = "+newfileName); System.out.println("The Filename on save caird on sdcaird = "+fileName); FileOutputStream outStream = null; File file = new File(path); file.mkdirs(); File outputFile = new File(file, fileName); outputFile.createNewFile(); outStream = new FileOutputStream(outputFile); BufferedOutputStream bos = new BufferedOutputStream(outStream); RL.setDrawingCacheEnabled(true); bitmap = Bitmap.createBitmap( RL.getDrawingCache()); bitmap.compress(Bitmap.CompressFormat.PNG, 100,bos); RL.setDrawingCacheEnabled(false); bos.flush(); bos.close(); btn_preview.setVisibility(View.VISIBLE); btn_save.setVisibility(View.GONE); } catch(Exception ex) { ex.printStackTrace(); } } 

    este código acima saveá o da canvas que você enviou, então simplesmente você apenas acessa ou busca essa image do seu nome de path específico do sdcaird

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.