Hi
I want to write an app that goes through all my stored SMS, lets me pick one and then would display the SMSC address which was involved in sending said SMS to my phone.
Question: Is this SMSC address stored somewhere? And just to be totally clear: I am not asking for the SMSC address of my operator which would be used for sending SMS from my phone to other phones, okay?
I tried to find something in the deprecated SMS content provider. But either I did not look hard enough or it's simply not there.
Has anybody got some tip for me regarding this?
thanks a lot!
gsm-man
Try the following code:
ContentResolver cr = context.getContentResolver();
final Cursor c = cr.query(Uri.parse("content://sms/inbox"), new String[]{"_id", "address", "date", "read", "body", "service_center"}, null, null, null);
Related
All the telephone numbers in my address book are stored in international format e.g. +44 +64 etc.
When I reference my address book to complete the 'To:' section of an SMS it pulls in the number but without the '+' sign. This prevents the SMS being sent without the '+' being entered manually.
Does anyone else experience this problem and has anyone found a fix.
Thanks.
i just made an entry where i put in the +45 in the first part of the telephone nr and then made a new sms and clicked to: and choose the freshly made contact and i get the whole nr in my case +45234567 (random nr dont try to call it at home )
i'm using the 1.66 rom and sync with the outlook 2k i got for free with my xda2 (qtek2020)
Thanks for that. I'm on 1.03.00 so I'll look for a ROM upgrade.
My goal is this: I have an external database with (company-) contacts as a SQLCE database. Since there are over 1000+ contacts in that database, I don't like the idea to 'load' all of them in my outlook. So when there's an incoming call I check if it is an outlook contact, if not I like to search the external database (by phone number) and create a contact 'on the fly' (NOT to be stored in poutlook!)
I 'detect' a new incoming call like this:
private SystemState _phoneIncomingCall = new SystemState(SystemProperty.PhoneIncomingCall);
_phoneIncomingCall.Changed += OnPhoneIncomingCallChanged;
This works like a charm. In the OnPhoneIncomingCallChanged method I check if the (new SystemState(SystemProperty.PhoneIncomingCallerContact)).CurrentValue is null. This too is working Now I would like to 'alter' the PhoneIncomingCallerContact with a contact I lookup in the other database using the incoming number. I imagine I should create a new contact and 'rethrow' the PhoneIncomingCallerContact.
The "OnPhoneIncomingCallerContact" function in the dialer should be triggered and the 'altered' contact information displayed.
Key question: can I create a SystemState(SystemProperty.PhoneIncomingCallerContact) "State and Notifications Broker" message?
And off course if so: how to do it in C#?
Another approach might be to 'unhook' the default phone application, get the incoming call and 'hook' the phone application back when I decide to take the call or reject the call?
Again: Is it possible and how to do it in C#?
Your help is appreciated...
Answered @ Windows Mobile Developer Center
If anyone cares
lextendo said:
Answered @ Windows Mobile Developer Center
If anyone cares
Click to expand...
Click to collapse
Thanks for sharing.
Hello,
I am using C# to send SMS from an application i'm writing.
i have tried either
1) Microsoft.WindowsMobile.PocketOutlook.SmsMessage
2) [DllImport("sms.dll")] int SmsSendMessage(...
but in both cases i need to specify a FULL phone number including country code (i.e. +972544...)
if i specify a regular number, the SMS won't reach.
the interesting thing is that when i use the built in SMS Phone's application and specify a regular number, the messages do reach.
So, have i missed something? Is there a standard way to make my messages be sent (have i forget a flag, special way of calling the API or what ?!)
Many thanks
Hi there,
I don't know a lot about programming, but maybe you could do something like the following example.
My country code = +316
Set all the country codes in a array (or something like it in C#)
When I type in the number 0612345678
Use some kind of script to split:
$countrycode = 06;
$phonenumber = 12345678;
Search in the array for '06'.
$newcountrycode = +316;
echo($newcountrycode,$phonenumber);
+31612345678
Click to expand...
Click to collapse
Maybe this will help?
issue resolved
Just to update - I found a solution to this problem
The API that I use is SmsOpen, SmsSendMessage, SmsClose (from sms.dll).
The SendSmsMessage API gets an address parameter which includes one of numerous values, the ones relevant for the solution are SMSAT_INTERNATIONAL (equals 1), And SMSAT_UNKNOWN (which is 0)
If the number starts with “+” use international, else use unknown and the phone will figue this out and add the relevant extension. Note however that the latter might not work when roaming.
enjoy
Ok this is a long shot but I'm hoping someone may be able to answer this question.
I need to know if it's possible to develop an application to replace the native sms messaging facility in Android (I would like to know if it's possible on other platforms too but I use froyo on my HD2)
according to GSM technical specification http://affon.narod.ru/GSM/GSM0340.pdf as long as the SMSC supports it then it should be possible to set the TP PID to create replacement codes in an SMS.
This allows you to send an SMS to someone with a code set and then send another message to them with the same code. The phone should recognise the same code and overwrite the message.
There are already ways that you can do this using a GSM modem and SMS gateway software such as Nowsms, Bulk SMS and Kannell etc. There is plenty of information on google. however these all require you to have hardware and send the messages from a computer.
The question I have is, would it be possible for someone to develop an app which allowed the user to specify if the sms was sent with the code set, directly from the handset?
Thanks in advance!
Just a bit of additional info from the nowsms support forums
“PID” – Specifies a protocol id field to be associated with the message. The web interface of NowSMS includes checkbox settings for specifying a “Message Type” value. Setting one of the “Replacement Type” values means that if the gateway sends a subsequent message with the same replacement type value, this will replace any previous messages that were sent by the same sender with the same replacement type value. When submitting an SMS message via URL parameters, replacement type values 1 thru 7 correspond to settings of PID=41 thru PID=47.
http://www.nowsms.com/discus/messages/1/13536.html
Also it seems like it may be possible, at least on winmo
http://msdn.microsoft.com/en-us/library/aa921493.aspx
Hello everyone,
I've queried Android's CallLog.Calls and populated an ArrayList with my call model object however when I display these objects in a RecyclerView, certain phone-numbers appear multiple times, once for each call entry that was made from or to that number.
I'd like to group the calls from the same number together.
Is there a built-in way in Android to group these call entries so that I can display them as a single entry in my call log RecyclerView?
I tried to add "GROUP BY" to the query but contentResolver.query() does not seem to accept it in any of its parameters.
Thanks!
You can remove the duplications after you get the data using a HashSet, for example:
ArrayList<String> items = getItems();
HashSet<String> hashset = new HashSet<>();
hashset.addAll(items);
items = new ArrayList<String>(hashset);