Android SMS limit? - android

Does anybody know what is the limit of sent SMS messages at once? Or it is limited hourly or daily?
I have Nexus 4 (4.4.4 KitKat). I am developing app that sends SMS messages so it is really important to me. I've found a lot of information but it seems none of it is correctly...
Thanks!

According to the creator of this app https://play.google.com/store/apps/details?id=com.bamf.smslimittool.donate&hl=en, the limit, since 4.4.1, is 30 messages in 30 minutes.
It also notes that the limit is present to safeguard against malicous programs, so setting it very high is potentially a bad idea.

In CM11,
Open your Root Explorer.
Go in /data/data/com.android.providers.settings/databases/
Open settings.db your SQL editor
Open the database ‘Global’
Press the Menu button> New Record / New Table
As set name: sms_outgoing_check_max_count
As value (value) type the maximum number of sms you want, personally I put 2000
Taken from http://www.openeducationus.com/?p=101682

Some limit was introduced not later than Gingerbread. As far as I know, and I investigated thoroughly, it is generally impossible to override these limits on non-rooted devices. If possible, those are rare exceptions. But, if your app is supposed to send messages from your device only or from controlled number of devices, you may get around this problem by setting SMS_OUTGOING_CHECK_MAX_COUNT to a huge number (say 99999) in:
/data/data/com.android.providers.settings/databases/settings.db
table secure
table system
/data/data/com.google.android.gsf/databases/gservices.db
table main

I dont think it has got anything to do with Android. In India, it is governed by TRAI Regulations for SMS.
And the limit varies based on whether it is transactional SMS, promotional SMS or personal SMS
*TRAI : Telecom Regulatory Authority of India

Related

How to check mobile data usage programmatically?

The question is pretty straight forward, How do I find out how much mobile data (in GB or MB) has the user used in the current month?
As it has been reported as off topic, I want to clarify that the data usage is supposed to be checked via code in an app.
Is there some code I can use to check for the users used data?
See: https://developer.android.com/reference/android/net/TrafficStats.html
Try:
Toast.makeText(this, android.net.TrafficStats.getMobileRxBytes()+"Bytes", Toast.LENGTH_SHORT).show();
getMobileRxBytes() Return number of bytes received across mobile networks since device boot.

SMS not received...only in certain cases...Carrier/Country?

I have a technical issue that I can't resolve because the problem only happens on the other side of the planet that I'm on.
So I am hoping someone with a lot more Experience with these technologies can suggest an alternate approach or path to take in order to rectify it, or possibly right out "RECOGNIZE" the source of the problem.
THE SCENARIO :
I have developed an application for the Samsung Gear2 that sends SMS messages using its host companion android application.
In all tests I perform with the app pair, everything works as expected.
Messages are sent by the android device's SMS manager and received by the recipient no problem, even when adding and removing the leading 1.
10 and 11 digit numbers to and from the USA, with and without the leading + sign all pass.
However, when sending the apps to Samsung for review and testing, they keep having problems sending certain numbers. As far as I can tell the only thing different between the numbers that send and the numbers that fail is the fact that the first has a leading 0 and the second does not.
This would have to be coupled with the fact that they are testing this functionality
in a different Continent/Country than the 1 where my tests are being done(USA).
As my tests succeed to send and receive the messages regardless of whether
the number is a 10 digit version or 11 digit version of the same number.
Also discrepancies surfacing from the use of different Carriers (possibly Telecom in Asia) other than the one that I am testing with(Bell - USA)...
To be clear, I am simply composing messages via the Gear2 app and sending it to the android device via Samsung's Accessory Protocol which works flawlessly.
From there I use the basic implementation of the standard
Android's SMSManager
getDefault()
and
sendTextMessage(String destinationAddress, String scAddress, String
text, PendingIntent sentIntent, PendingIntent deliveryIntent)
with all null values exept the "destinationAddress","text",
and the "sentIntent".
THE QUESTION(s) : in order of most to least important
1. IS THERE a specific "routine" SMS app developers use to maximize the
success rate
of sent sms messages no matter what Country or Carrier the user sends the message from or to, and no matter if the entered number contains the leading exit and Country codes?
(ie: Adding or removing a plus(+) sign, per-examining the Locale
being used and adjusting the number accordingly using some sort of
"SMS Numbering Standard", Altering the Service Center Address / SMSC
Address (AT+CSCA), ect...)?
2. IS THERE some sort of information source detailing general "GOTCHAS" to look for
dependent upon the various Cell/SMS service providers/Carriers? (at least 4 that I know of).
3. Why would Android's SMSManger report "SMS Sent" if the message wasn't actually delivered.
NOTE: I realize that one can also listen for the "second" broadcast android sends
confirming that the message was "actually" received by the recipient, but that raises questions concerning how to rectify that situation, if it's at all rectifiable (at least from a programmatic perspective.)
4. Should my app, which is actually a Samsung Gear2 app integrated with an android app,
and merely delegates the responsibility of sending the messages to the android devices SMSManager, be held responsible for the message not being sent?
NOTE: I can't help but feel that Samsung is requiring me to handle
issues outside the scope and unrelated to the apps intended
functionality, Albeit , I do understand that at least part of the
issue has to fall back on me by Default, being the nature of the Gear2
apps dependance on the android device to complete the intended action
started by the Gear2 app, but how far must I go to ensure the standard
SMS abilities of a users android device beyond giving helpful feedback
as to what the underlying problem may be. I have to assume this
problem would exist using the device itself to compose the message
instead of the Gear2 app, given the exact same address/number .
5. Assuming that the app is being tested in Asia (South Korea, Samsung's Headquarters)... And assuming that the carrier being used to test SMS is SK Telecom
(Which I think is South Korea's top Carrier)...
Is it Mandatory to start all numbers with a zero in order to successfully send an SMS within the same Country? And if so is that the same in all Countries besides the USA and Canada(Which seem to work either way)?
6. Is this a common issue to deal with generally when developing sms applications, or can I single this particular situation out from the rest based on the unique variables introduced by Samsung's over diligent testing practices along with there unfamiliar
Telephony Service Providers and even more unfamiliar Geo-location/Country-code and numbering schemes.
THE PROBLEM *(only happens during Samsung testing) :
TEST 1:
Send SMS from stored contacts with number 010-6627-xxxx (11 digits)
Result:
SMS is reported by android's SMSManager as sent. The recipient
immediately receives SMS message.
Conclusion:
SMS delivery success.
TEST 2:
Send SMS from manually entering number 10-6627-xxxx (10 digits) (same number as previous without first 0)
Result:
SMS is reported by android's SMSManager as sent. However, the
recipient never receives SMS message.
Conclusion:
?
Unable to duplicate this problem (at least not in the USA) as both :
11 digit numbers (leading 1) AND 10 digit numbers
(no leading 1)
Successfully send the message as expected.
The problem only happens during device testing/certification by Samsung's app testing
department, and seemingly only when manually entering the destination address/number.
Stored Contacts (for some reason) always work.
After being denied certification of an otherwise "GOOD TO GO APPLICATION" 3 times by Samsung for issues UN-recreatable in my own testing environment I find myself turning the good folks at SOF with this "HAIL MARY PASS".
I do not change anything at all about the numbers that are sent to the SMSManager, But I'm wondering if maybe THAT'S the problem.
EXTRA INFO :
All devices used are using android 4.2 and higher.
My tests were all done using T-Mobile Galaxy phones and sometimes google/Gmail/GoogleVoice
sms/mms service From North Fla. USA.
ON A SIDE NOTE ABOUT SAMSUNG...
Samsung's testers are very sparse with the details of their testing enviroment including what may possibly be the issue from their standpoint which is unfortunate because I'm becoming certain that this issue is Trivial at best and probably easily fixable with a basic understanding of your own Country/Carriers methods for sending successful SMS messages.
It seems they are not even making an effort to enlighten me or TO make any neccesary
adjustments to their test numbers as any user would do in order to have a successful result.
ANY INSIGHT INTO THIS ISSUE WHATSOEVER WOULD BE IMMENSELY APPRECIATED!!!
Interesting question. I understand that the Samsung testing process can be quite rigorous.
From reading your info .. have you tried including that leading "0" yourself? E,g when a person manually enters 10 digits without a leading 0, you detect it and add this "0" . Also, how are this digits entered on a gear 2 device ? Do you implement your own keypad and ensure it captures the right digits ?
I guess that would be a starting point ..
V.

Detect which phone number is sms capable

Is it possible to determine whether a phone number is SMS capable or not, i.e. it is a mobile number? I realize that the user can set the type of number when editing the contact, but I'm looking for something authoritative.
Thanks.
You can use libphonenumber for determine if one number is mobile or not, but in some countries ( like USA ) there's no distinction between mobile numbers and landline numbers.
Hope that helps you.
If you're ready to pay then there are two websites I know which can provide you API to lookup whether a phone number is cell phone or landline using NPA and the NXX information (only for US and Canada I think so).
I don't think they'll be smart enough to tell you whether a number is ported from landline to mobile or not. But that becomes unusual case for current market scenario.
1) Strikeiron
2) SearchBug
You haven't mentioned whether you want a system based on US or entire world. So I assumed only US while answering.
I hope this will help little bit.
There are providers like Trestle that provide whether the number if ported and currently it is Landline/Mobile/Fixed or Non Fixed VOIP, etc. That should help determine if the number is SMS Enabled, etc.

Android How to identify carrier on CDMA network?

Android provides the following method to determine the network operator:
http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperatorName()
However even the documentation specifically says:
Returns the alphabetic name of current registered operator.
Availability: Only when user is registered to a network. Result may be unreliable on CDMA networks (use getPhoneType() to determine if on a CDMA network).
The problem is that we need a reliable way to detect the carrier so we can identify the traffic source. Has anyone had a similar problem and if so, what is the best solution?
My phone is on Verizon Wireless. On a daily basis, I drive through areas where my phone is roaming and/or has poor reception. Using scripting layer for android, I will log the results of calling getOperatorName() once every ten minutes over the next week.
There is another method that might work in the android.telephony.cdma api. The documentation there is missing the reliability disclaimer. You would only get a Network ID instead of a name. Unfortunately, this requires API level 5 instead of 1 if that matters to you.
Logging the results of the getOperatorName() method yielded nothing special. When I had no service it consistently returned null and when I had service it consistently returned "Verizon Wireless." I'm sure that's not very helpful.
Edit: Addition and correction.
Added - Explanation of link
Corrected - API level 5 not 17
Edit 2: Test results
I am currently looking for a solution for this problem as well. According to this thread one could use CdmaCellLocation.getNetworkId and CdmaCellLocation.getSystemId. Since there are no CDMA networks in Germany, I am unable to check if this works...
You think maybe this was one precurser to Google pulling cdma support? Play within the frameworks or find you another playground is what I hear Google saying. Well that and the fact that carrier apps burned into roms have at times left gaping holes in security.
As to a possible answer to your question... from where are you able to pull info? APN settings might tell you or an assert to a known carrier line in build.prop could pull the info I might need for example. (I do the hobby roms). Then again if you physically inspect a phone, the carrier is usually branded ;) From what vantage are you pulling the info?
Rob

Android emulators with phone numbers?

I'm working on a client-server Android application and trying to figure out how to identify different phones/users to the server unambiguously. My first attempt would be to use the phone number on the SIM card. Although now that I think about it, how common is it these days that your phone number changes when you e.g. change carrier? I guess it depends from country to country etc.
Anyway, I've been trying to figure out, since I don't have actual Android phones, how to change the phone number of the emulator phone to simulate different users. Is it possible or should I just think about alternative ways of identification?
The android_id is supposed to uniquely identify the device, however, it has been noted that the id can be changed if you know how Spoofing android_id
import android.provider.Settings.System;
String android_id = System.getString(this.getContentResolver(), System.ANDROID_ID);
In the emulator, the android_id does not have a value, so you will need to put a debugging routine in to assign a value yourself.
However, if you want to identify the user, and let the user access your service from different devices with one user id you are better off assigning them a user id and having them authenticate to your service using this user id as their credential. This would let them use their id's on many different devices, unless you used it in conjunction with the android_id (and the android_id wasn't spoofed) then you could limit them to one device.
You should use the number present by the emulator. Eg. usually first emulator that is running has number 5554, second 5555, and so on.
You can use these numbers to make calls, send text messages from emulator to emulator. This, I think, simulates different numbers/users for your purposes.
The SIM card info is hard-coded into the emulator-arm and emulator-x86 binaries. Changing the phone number (MSISDN) is detailed at the end of this blog post: new link, web archive
The SIM card stores the phone number with each 2 digits swapped. So (the first 7 of the phone number) 1555521 becomes 515525%d1 in the binary. While a little tedious, patching it for each test isn't the end of the world. You could also use sed:
cd path/to/android-sdk-linux/tools/
cp emulator-arm emulator-arm.backup
sed -i 's/515525%d1/816745%d3/g' emulator-arm
That will change the number to 1-876-543-[PORT NUMBER]. Details on why are in the linked blog post.

Categories

Resources