Get Picture Messages To C++ program - android

I'm currently thinking of setting up a picture message import project. Something like this:
Client Mobile Device [picture message] -> our Server Device
Server Device [picture && number -> Server Computer
However I don't know if there's a possible way to do this. I could set up a google voice account and use something like this in order to retrieve messages, however this doesn't allow picture messages...
So I was thinking of perhaps making an android or iPhone application to redirect picture messages. Though I don't know if this is possible. If it is, how would I go about gathering the messages? The networking is simple enough, however I'm not familiar with the android system, nor the message system of the iPhone.
On the other hand, I could make a simple email server to receive messages from the cell phone provider's email system.
Is any of the above viable? The image as well as the origin number are both needed.

This sounds like a typical client/server application actually, except the commands sent to the server contain binary data.
There are many ways to do this, and many protocols you can use. Email (gmail) is just one example.
What I would do is use HTTP to post binary messages to your web server. This is cool because it manages authentication, data transfer, etc, are all available.
Here's a short example: Secure HTTP Post in Android
Just add authentication on top of that and you're in business!
You would have to do some web server development too.
I hope this helps.
Emmanuel

Ok I think this is possible. I'm not sure how it works but I'll do my best.
First you have to be notified when an SMS is received by listening to SMS_RECEIVED events. BroadcastReceiver + SMS_RECEIVED
Second, you have to read the SMS attachment as explained here: Get attachment from unread MMS messages
Does this help?

Related

How to send text message to Azure Bot?

Totally new to Azure and the services it offers, I face many questions about the "Speech" service and the bots that can be created on the Microsoft platform. Currently developing an Android mobile application I'd like to realize the following behavior:
The user records a voice file from the app (using MediaRecorder), this part is ok
Once the recording is finished, this file is sent to Azure function(via an HTTP POST).
The file is translated into Text
The text is sent (step 7) to the bot which reacts accordingly by executing an HTTP request.
Scheme of the process I explained
First of all I wanted to know if this scenario is possible or if I have to use the Speech SDK on my Android application.
Moreover if this scenario is possible, how do I send the text to the chatbot? I've checked this link but it doesn't seem very relevant to me.
NB: My bot has been completely created using "Bot Framework Composer" for the moment, no code has been written, I just wanted to know if my scenario is plausible and above all possible.
Go through your steps, and I think it can be implemented. If you want to send text to bot, you can refer to this request.
Before that, you may need to start a conversation and get the conversationId.

Is it possible in GCM/FCM to get last activity or if the user is connected?

Am using GCM in my android project, the connection is XMPP, I wonder if there is a way to know if the user is currently connected from within the server service?
One way to do it is that I can send the user a ping and wait for a reply to see if he is connected but I was hoping for a better solution like to query GCM directly and it will tell you if the user is currently online or his last activity date.
I am trying to avoid using socket.io or signalr, because it will add load to the server specially if you have like half million users who are pinging the server regulary.
Thanks
The API you are looking for is not very well advertised, but it exist!
HEADERS: Authorization:key=SERVER-KEY
GET: https://iid.googleapis.com/iid/info/GCM-TOKEN?details=true
Full documentation here: https://developers.google.com/instance-id/reference/server

How does user's whatsapp application detects change in profile picture of its contact?

I was going through whatsapp application and I noticed that, for the first time it fetches thumbnails from the server, keeps them in cache memory, and thereafter it fetches these from the cache memory instead of server. (Like bitmap lazyloading).
Till now I have completed implementing the bitmap lazyloading part.
However I have a question as follows:
When any contact changes its profile picture how does the user's whatsapp application detects that particular change and how does it update that particular thumbnail only, cause the application is supposed to fetch the thumbnails from cache memory.
I am clueless about this. Any help is appreciated.
EDIT:
Does it use push notification to notify the client applications to update the corresponding profile thumbnail?
Source:
WhatsApp is build upon C2DM and XMMP for message delivery. MQTT is another protocol which is used to minimise the battery usage.
When any contact changes its profile picture how does the user's
whatsapp application detects that particular change and how does it
update that particular thumbnail only, cause the application is
supposed to fetch the thumbnails from cache memory
Answering your question: So WhatsApp may be using XMMP push or a GCM push notification(C2DM is deprecated ;] ) to inform all the client that some event has occurred and all it's client needs to take care of the same. In your case event is to update your profile pic in devices of your friends in WhatsApp contacts
In your case, you can use GCM to update clients regarding such events.
I don't have much idea about XMPP but You can also have a look at Smack API(An Open Source XMPP (Jabber) client library for instant messaging and presence) and this interesting post
I hope I answered your question. Good Luck :)
Edit:
GCM is a service from Google that uses a persistent XMPP connection to communicate with Android devices. You can use any of the following techniques of GCM to achieve this.
Send "send-to-sync" messages
Send messages with payload
An easy way to handle this situation will be to keep an modified datetime in the table where you store the path of the image and thumbnail. You have to keep the url of the image along with the modified date as the parameter.
Eg:
http://yourdomain.com/images/user_id.png?q=modifieddatetime
Whenever the app will try to open this link, it will first check whether it is available in cache or not. If not the new image will be fetched from the server.
I have not tried this on Android, but it should work. I usually do this in my web applications.

Using/Obtaining SMS short code for application

I have searched google and have not found the answer I was looking for only bits and pieces. I would like to create an application where a user could text a SMS shortcode number with a certain string of text "example: IN" which would then run a command on a server if it matches a specific keyword. Basically it would update a database and then send a message back to the user. My questions are how do I obtain a SMS Short code number? How do I link that with a server? What programming language is the most efficient and effective for accomplishing the task? I have a little bit of programming experience in "HTML, JavaScript, PHP and C" and am willing to learn more languages if required. If someone could answer these questions for me I would be grateful.
Twilio offers this along with their other telephony services. I haven't actually used their SMS service, but I've heard good things about the company in general.
For less than 1/100 of the price of a dedicated shortcode, you can start with a "shared shortcode" provider like TextMarks.
TextMarks owns the "41411" shortcode, and you can lease keywords on it for use with your own applications.
You configure a callback URL, and any incoming SMS messages starting with your keyword get routed to your own web server as HTTP requests. If you respond with anything, your message even goes back to the user as another SMS response.
More info:
TextMarks SMS auto-responder API overview
[Disclosure: I built a large portion of the TextMarks API! Ask me anything.]
You will need a SMS server which is not very common. So you should look for providers like SMSMode or Essendex. But you'll have to pay to receive and send SMS.

Anonymous Email from Android

Its been some weeks im looking for it, but just cant find. Does anyone know how can you send anonymous email from a Android? Im using Intent like in:
Intent email = new Intent(Intent.ACTION_SEND);
.
.
.
email.putExtra(Intent.EXTRA_EMAIL , new String[]{"sendingToThisEmail#gmail.com"});
email.putExtra(Intent.EXTRA_SUBJECT, "subject");
email.putExtra(Intent.EXTRA_TEXT , "any stuff");
But this, or any other thing ive tryed always send the e-mail from the acc you are already logged by default on your Cell phone.
You won't find a straightforward way to do this (i.e. with Intents) unless you find some third party library. Also keep in mind that even if you send the email anonymously, the client IP will still be logged in the email.
Something like this might help you get started, but the basic idea is you'll want to find (or setup) an open SMTP server, connect directly with TCP and send messages using SMTP which is a mail protocol, obviously setting some sort of dummy from address.
I can think of a solution which takes the user message to a textbox and onSubmit sends the data to the server. At server side user messages are stored in databases where periodically a email sender program checks for the new messages and sends them to respective email ID.
Pros:-
Since emails are now being sent from one side it will be easier for you to send anonymous emails. i.e. you can have a dummy account like userMessage#yourdomain.com.
User IPs wont be tracked by the mail servers since a central server is sending the mails.
You can filter the messages which contain spam messages or abusive language by text filtering techniques.
You can store the messages for future use. For Pattern Analysis / Statistical Analysis. At the end of the year you will be able to generate reports, If needed in future.
Cons:-
Mails may not be sent immediately, well that largely depends how often your mail
sender runs an optimum delay is required.
That may require some extra memory space in your database.
this link may be helpful for sending portion, and finally, You are programming for good, keep it up!!!

Categories

Resources