gsm

Getting Tower GSM location lat lng

a 夏天 提交于 2019-11-29 23:26:37
问题 I would like to know a method or a way to find the location of the cell the mobile is connected to (GSM one) This is my class: package com.example.signal; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import java.sql.Date; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.LinkedList; import java.util.List; import android.location.Location; import android.location.LocationListener; import

Switching between gps and network provider according to the availability

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-29 21:15:24
问题 public void onCreate() { locationListener = new GeoUpdateHandler(); locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); try { gps_enabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); network_enabled = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER); } catch (Exception ex) { } if(gps_enabled) { locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, TIME_DURATION, 100, locationListener); } else if(network

How to check if an AT command executed successfully or failed

核能气质少年 提交于 2019-11-29 16:22:42
How do I place a check programmatically if the AT command executed successfully or failed. I have placed following check: boolean success = response.endsWith("OK"); boolean failed = response.endsWith("ERROR"); I just want to be sure if this check can be placed universally, or atleast on AT+CUSD command. I cannot place contains check since the ussd response can itself contain 'ok' or 'error' strings. Excellent step on your behalf to investigate how to do things properly instead of just stopping on "well, this seems to work by trial and error". Yes, OK and ERROR are universal but ERROR might be

error +HTTPACTION:0,601,0

我们两清 提交于 2019-11-29 14:06:38
问题 I m trying to access a website using sim900 GSM module. This is the list of commands AT+CSQ +CSQ: 16,0 OK AT+HTTPINIT OK AT+HTTPPARA="CID",1 OK AT+HTTPPARA="URL","www.google.com" OK AT+HTTPACTION=0 OK +HTTPACTION:0,601,0 AT+HTTPACTION=0 OK +HTTPACTION:0,601,0 Unable to access google. 601 code shows Network error. How to get rid of this error? 回答1: You need to setup the connection to the bearer. Here are the minimum setup commands that have worked for me (based on trial/error and searching

How to get the telephone number associated with the SIM in a GSM phone? [duplicate]

﹥>﹥吖頭↗ 提交于 2019-11-29 05:23:25
Possible Duplicate: How to fetch own mobile number in android How to get the telephone number associated with the SIM in a GSM phone? try following code TelephonyManager tMgr=(TelephonyManager)mAppContext.getSystemService(Context.TELEPHONY_SERVICE); mPhoneNumber = tMgr.getLine1Number(); and with following permission in your xml READ_PHONE_STATE 来源: https://stackoverflow.com/questions/5163803/how-to-get-the-telephone-number-associated-with-the-sim-in-a-gsm-phone

How to check if iPhone supports CDMA or GSM

爷,独闯天下 提交于 2019-11-29 02:45:26
Is there any way to identify if iPhone supports CDMA or GSM network. Any Apple API in Objective-C which can provide this information. You might examine model id with the function ( credits ): #include <sys/types.h> #include <sys/sysctl.h> NSString* machine () { size_t size; // Set 'oldp' parameter to NULL to get the size of the data // returned so we can allocate appropriate amount of space sysctlbyname("hw.machine", NULL, &size, NULL, 0); // Allocate the space to store name char *name = malloc(size); // Get the platform name sysctlbyname("hw.machine", name, &size, NULL, 0); // Place name into

Send Unicode (USC2) SMS with AT commands

佐手、 提交于 2019-11-28 12:43:45
I am trying to send Unicode SMS using at commands and USC2 encoding. But it doesn't work, as I get errors. Here is my inputs: AT OK AT+CSCS = ? +CSCS: ("IRA","GSM","UCS2") AT+CSCS="UCS2" OK AT+CMGF=1 OK AT+CSMP=1,167,0,8 //So this one doesnt work, let's try with 17,167,0,8 ERROR AT+CSMP=17,167,0,8 OK AT+CMGS="+370********" ERROR Or maybe I should use PDU mode to achieve this? I have tried using older modem, and USC2 works in that one, however not in one im using. But im sure this conflicting modem supports USC2. I found I just needed to encode my number in AT+CMGS to UCS2, and now it works: AT

How to check if an AT command executed successfully or failed

断了今生、忘了曾经 提交于 2019-11-28 10:33:04
问题 How do I place a check programmatically if the AT command executed successfully or failed. I have placed following check: boolean success = response.endsWith("OK"); boolean failed = response.endsWith("ERROR"); I just want to be sure if this check can be placed universally, or atleast on AT+CUSD command. I cannot place contains check since the ussd response can itself contain 'ok' or 'error' strings. 回答1: Excellent step on your behalf to investigate how to do things properly instead of just

Get mobile cell tower timing advance on Android 2.3

徘徊边缘 提交于 2019-11-28 09:22:03
问题 I need to get the mobile cell tower timing advance. Is it possible on Android 2.3+ ? [edit] It seems that it's not possible to retreive the timing advance... Is it possible to know the distance between the mobile and the cell and the bearing otherwise ? I suppose I can't use the Google hidden geolocation api in commercial application ;-) [/edit] Thanks 回答1: This is currently not implemented, and it will be a hard task because it is device-dependent. The actual timing advance is only known by

End of response to an AT command

喜夏-厌秋 提交于 2019-11-28 09:18:56
问题 How to be sure what is end of an AT command send to GSM module? I need some character or string that represent end of AT command for every case due to finding when whole response is received. I guess it have something with "\r\n" sequence but, this sequence could be at the beginning of AT command response? 回答1: Like you suppose it's \r\n . This defines the end of a line. And it makes only sense to process complete lines. Some commands respons with only OK\r\n , some with some data. So you