android


How to convert picture into text and send it as a sms in android


I have develop an android app in which user can send message to any number using SmsManager Api.
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage("phoneNo", null, "sms message", null, null);
Now I want that user will send small picture to any number using
smsManager.sendTextMessage("phoneNo", null, picture, null, null);
I don't want to send this picture through MMS.I know this can achieved by converting picture into string at sending end and reconverting string into picture at receiving end. But i don't how to do this. Here is a snapshot of android app which has acheived this task. I want to do this as shown in snapshot link
Use following code
/**
* Encodes the image to Base64.
*/
private String encodeImage(String photoPath) {
File imagefile = new File(photoPath);
FileInputStream fis = null;
try {
fis = new FileInputStream(imagefile);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
Bitmap bm = BitmapFactory.decodeStream(fis);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bm.compress(Bitmap.CompressFormat.JPEG, 80, baos);
byte[] b = baos.toByteArray();
return Base64.encodeToString(b, Base64.DEFAULT);
It is not possible. because if u convert image to base64 than no of characters are more than 300(for smallest image of 50x50) so it will become MMS.

Related Links

How to authenticate multiple accounts in Android dropbox sdk 1.5.1?
What Type of Hash is the Test Device ID of AdMob?
Move Image Taken With Camera Leaves Broken Link Unitl SD Card Remount
startService restart my service if currently running, the Android docs say the opposite
Localization for android EditText [duplicate]
Programatically give space between buttons in table layout
Not receiving an Intent back from Zxing barcode scanner
Android app doesn't work on Android 4
Add item in listview only if not already present
Streaming Webcam in android using yawcam
setTextureRegion AnimatedSprite
Phonegap low performance issue
Shared Preference & Spinner Not Maintaining State
Why don't I have touchscreen support in Android SDK Manager?
Loadable Kernel Module: Unknown symbol malloc_sizes (err 0)
NullPointerException after resuming the application

Categories

HOME
go
rsa
static
numbers
requirements
gradient
dojo
pyqt4
banner
trac
special-characters
sendgrid-api-v3
mql5
augeas
little-proxy
octave
vimdiff
android-securityexception
libc
dynatrace
symfony-2.8
swagger-2.0
user-experience
react-toolbox
onload
beautifier
bulletphysics
pylons
angular-translate
bringtofront
iis-express
browser-sync
testcomplete
kodi
turfjs
r-grid
memory-address
spring-security4
papaparse
pop3
ideascript
modernizr
kill
plaintext
postgresql-8.4
mesosphere
openrasta
clarifai
jquery-ui-draggable
corruption
bbpress
objectscript
jtree
restore
donations
vcloud-director-rest-api
stax
custom-lists
centrifuge
async.js
myspace
tinkerpop3
windows-azure-queues
mapinfo
delta
mediametadataretriever
database-relations
maybe
wso2greg
keyup
xmltype
mmwormhole
ejb-2.x
rapidsvn
named-parameters
multitasking
gtm-oauth2
mysql-error-1044
observium
android-icons
preload
extconf.rb
database-create
usertype
convention
matlab-load
cuteeditor
cdonts
socketserver
timertask
instantiationexception
filesystemobject
lalr
web-application-project
flvplayback
change-management

Resources

Encrypt Message