How to update the settings Through SMS - android

I am developing one GPS based application. in that i given few default values to user those are phone number which will used to make a phone call. and server address which is used to sent the location data to server.. In this I got 2 major and critical problems..
1) I have hide that default values in regular menu and that should display when user presses some key or combination of keys then only it should display.
2)When ever the Default phone number and server address is changed at provider side that should be updated at user side that should happen through SMS from a specific number in a encrypted format by accepting that SMS those values has to change
Please Any body knows about these things help which are very very very useful to me
Thanks for reading

Lots of good info here.
Having used SMSes to communicate with apps in the past, I highly recommend finding another way if possible. The messages coming in are often gibberish to the user, and practically never contain any information that the user needs to know about. They're confusing and they clutter up the user's phone experience.
I'd recommend using WAP pushes or periodic device-side checks instead. If you have to use SMSes, you may want to consider using the SMS content provider to delete the messages after your application responds to them. It'll still be annoying to the user, but at least you won't be leaving behind garbage in their messaging app. Be aware though that the SMS/MMS content providers aren't published, which means that they're not guaranteed to work, manufacturers can modify them however they want, and they could be phased out in a future SDK release.

Related

Wear OS/Android communication method recommendation

I am trying to determine the appropriate communication method between the mobile device and wearable for an application. I have been using notifications, which are ok, but the output is not always formatted the way I want. Example: when I include an image (a simple check mark) with no text, the image does not sit right in the center of the wearable. It's just below for scrolling purposes. Also I cannot control things such as vibration variations for different notifications. Also for future enhancements, I might need multiple smaller images in a single alert.
I have been looking at syncing data items but don't know if it will work for my first scenario and was hoping I could get some advice from the community.
Example:
There are a list of items on the wearable (this will be configurable). Each will have a image/png associated with them. Some items may have the same image. When the item is pressed the image (plus some text potentially) needs to appear on the watch with a specific vibration, then disappear.
A running history will be kept on the mobile app, but is not necessary for the watch. My concern with using the data sync is that this is that this is not really syncing data between the two devices, unless there is a "current item" which is being synced.
Hoping for some guidance from the community.
The Data API is really for keeping persistent items in sync between phone and watch. I'm not clear enough about your app's architecture to be sure if this is your best choice, though your configurable "list of items" sounds like a classic Data API use case. If you're not syncing these items, how will the list appear on the watch?
The Message API is more for one-off event signaling: something has happened on one device that needs to trigger an action on the other, and then it's done. And some of your description does sound more like this scenario... but again, I'm not clear enough about what your app is really doing.
And it's always possible that the you'll use both APIs for different aspects of your app; perhaps sending the configurable list of items via the Data API, then triggering events using Message.
Hopefully that's enough clarity on the two APIs to move you forward. If not, some additional details on your particular use case(s) would probably be helpful.
Edit after clarification in comments:
Your use case is still not entirely clear, but here's what I'd say:
If you're only showing a notification (or equivalent) on the watch at the point that an item on the phone is clicked, use the Message API to send those events.
If your watch app will show what has been clicked - whether just the most recent, or more extensive history - use the Data API to both "send the event" (by updating the DataItem) and maintain that record.

Under what circumstances does Android require user intervention to send a SMS?

I'm developing an app that will send very infrequent SMS messages from a foreground service. By very infrequent we're talking a few times per year at most, if the app is not severely misused by the user themselves.
I tested it the other day on a real device, and up popped a dialog that said something along the lines
AppName is trying to send an SMS.
Do you want to allow this?
Accept Decline
[ ] Never ask again
I don't remember the exact phrasing, and I haven't been able to reproduce it. I wouldn't swear on it, but I'm fairly certain it was on a device running Android 4.4.4.
This was the first time the app tried to send an SMS on this device, so I don't really think that it is related to SmsUsageMonitor.isUnderLimit(). Are there an other security checks and whatnot that would apply to sending SMS from a foreground service (including all versions of Android, not just 4.4.4)?
SmsUsageMonitor seems to do some checking for "premium" numbers, and might possibly require some form of user acceptance in case an app tries to send a message to such a number. If this is the case, is there any way to "pre-approve" my app for sending to any number - including premium ones
- once and for all? Or could manual user approval still be required some time in the future, if for example a new recipient number (which might be a premium number) is used?
It seems I was able to reproduce this after changing the package name of the app (uninstalling didn't help). This is indeed related to premium number - or rather what SmsUsageMonitor considers to be premium numbers.
For me, in Sweden, it seems like numbers that have 5 or fewer digits and are not emergency numbers (like 112) are considered to be premium numbers. This is somewhat backed up by Wikipedia on Short Codes
Sweden
Codes are five digits in length.
This is the dialog that pops up. After checking "Remember my choice" and clicking Send, the dialog doesn't appear anymore. The setting can be changed in App Info, where there is a setting called Send Premium SMS.

Why does one app launch faster than the other?

I'm curious about this. I have an app called GoSMS PRO and an app called Contacts+ installed in my phone. They both popup an alert notification when a text message is received. However, GOSMS PRO always beats Contacts+'s popup. I was wondering how this was happening in a programming perspective? Is there a way to give a certain app more preference than the other.
From security and permission side every app from Google Play has similar privilege, if they are not signed by the certificate of device manufacturer. This also means that none of the app will get extra preference.
Some time app do many type of checking/initialization/loading before showing their UI and when this type of things happens apps take longer period to load or display UI.
Most common things people do
Creating and initializing database
Reading database.
User validation (reading file)
Device state scanning(network)
Most common case is database access. I wonder if the app reading Content Provider before showing UI it might take long time depending on your device hardware and number of contacts.
Key strategy would be showing the UI right way and load data in background. Android has lots of Asynchronous api, just to avoid this type of scenario.

Request for permission to access location trough SMS?

I'm trying to figure out how to request another Android device for permission to access its location. Maybe through some link on a SMS to launch Google latitude?
The point is it should be instantaneous, like a Notification or an SMS.
What would be the closest strategy you can think of?
UPDATE:
Thanks guys for all your answers. After considering them all I am still a bit confused about what strategy to adopt.
Probably is better to tell you what I'm trying to implement:
Someone is going to pick you up. You send him a request, he accepts and the app shows you how far away he is and how long it will take him to get to you.
I didn't want the receiver to be forced to have the app cause it would lower its use. I guess that requisite could be dismissed.
Sorry for the confussion.
If you don't want the receiving user to have to install an app, you could send an SMS with a link to a website you control that uses web geolocation APIs to report position: http://dev.w3.org/geo/api/spec-source.html
The user will need to click the link in the SMS, then they will be prompted to allow the page to access their location. This will work not only on Android devices, but on any device with a browser that supports these APIs
It depends on how heavy duty your apps are.
If I were you I would write a system where the Apps would maintain a connection to a central server. That way your Apps can be notified the moment that anything happens. It could also be seamlessly integrated allowing your App (make sure you ask permission to allow it initially obviously) to send location data when requested without any interaction.
This is obviously more battery intensive for such a simple operation, but that is the best way to get instantaneous notifications.
Another way you could do it is to simply send an email to the recipient with a custom URL scheme.
Such as:
yourlocationapp://get.location/respond.to
You could parse that kind of URL in your App by setting:
<data android:scheme="yourlocationapp" />
In your intent-filter.
This requires more in the way of user interaction though.

How to catch an incoming text message

I want to be able to control incoming text messages. My application is still on a "proof of concept" version and I'm trying to learn Android programming as I go.
First my application need to catch incoming text messages. And if the message is from a known number then deal with it. If not, then send the message as nothing has happened to the default text message application.
I have no doubt it can be done, but I still have some concern and I see some pitfalls at how things are done on Android.
So getting the incomming text message could be fairly easy - except when there are other messaging applications installed and maybe the user wants to have normal text messages to pop up on one of them - and it will, after my application has had a look at it first.
How to be sure my application get first pick of incoming text messages?
And after that I need to send most text messages through to any other text message application the user has chosen so the user can actually read the message my application didn't need.
Since Android uses intents that are relative at best, I don't see how I can enforce my application to get a peek at all incoming text messages, and then stop it or send it through to the default text messaging application.
Espen,
The answer to this is multi-part. Understand first that our company has resolved this problem, but the solution is temporarily proprietary, so I will answer what I can without causing conflict either here or for my company.
1) You can never insure that your App ever gets first pick. What you can do is make your processing "fast enough" that is does not matter.
2) Intents ARE an absolute if you force the issue. Our company uses a concept called intent routing. This insures that the data is sent to the appropriate app. The most basic idea is that when you receive the SMS, you create a New Intent (not the same one) and send it to the class directly. This has some special considerations, but should give you some direction.
Unfortunately, without violating my company's confidence or stackoverflow's policies, I cannot say anymore publicly until the solution is made public (within the next month).
FuzzicalLogic
Retriving all incoming messages is just setting up listener, you can do it easily see here
and after that, its fine if you are at do nothing phase, but in case you want to prevent sms to go into the native messaging app it is not advisable to prevent user.
better you wait for some time and then delete the same from SMS database.

Categories

Resources