|
Isn't this what was proposed weeks ago?
I must get a clever new signature for 2011.
|
|
|
|
|
Is there a specific reason why you have not put the sendTextMessage inside the loop?
for (String string : myArr) {
sm.sendTextMessage(string, null, message, null, null);
}
Of course it would be advisable to implement the send and delivered intents.
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
"Philosophy is a study that lets us be unhappy more intelligently."
-Anon.
|
|
|
|
|
The array contains a list of numbers, not messages. He is trying to send a single message to multiple numbers.
I must get a clever new signature for 2011.
|
|
|
|
|
Right, and he was trying to concatenate the numbers into a delimited string and call the function once, I suggested, that instead of calling the sendTextMessage function once with a delimited string of numbers, he could try calling the function multiple times with each of the numbers.
Anyways, it seems it isn't working for him. I'll try it out myself and see if I can figure why not.
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
"Philosophy is a study that lets us be unhappy more intelligently."
-Anon.
|
|
|
|
|
My apologies, I totally mis-read that line; I suspect my brain was powered off.
I must get a clever new signature for 2011.
|
|
|
|
|
Richard MacCutchan wrote: my brain was powered off.
No Problem, I've been there too often
I have posted below, some code that worked on my emulators and another forum link that suggested the solution.
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
"Philosophy is a study that lets us be unhappy more intelligently."
-Anon.
|
|
|
|
|
Thanks for reply but result is same,one first number got sms.
Really i stuck here,now i need some extra ordinary tips or example to solve that problem.
Please help me
|
|
|
|
|
Well, this worked for me.
package com.partho.smstomany;
import android.app.Activity;
import android.os.Bundle;
import android.content.Intent;
import android.net.Uri;
import java.util.StringTokenizer;
import android.app.PendingIntent;
import android.telephony.SmsManager;
public class pSMSToMany extends Activity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
String message = "Some Message";
String phoneNo = "5556;5558";
StringTokenizer st=new StringTokenizer(phoneNo,";");
while (st.hasMoreElements())
{
String tempMobileNumber = (String)st.nextElement();
if(tempMobileNumber.length()>0 && message.trim().length()>0) {
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage(tempMobileNumber, null, message, null, null);
}
}
}
}
Actual code from Here[^]. Dumbed down to try it out.
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
"Philosophy is a study that lets us be unhappy more intelligently."
-Anon.
|
|
|
|
|
Hello
I'm writing bluetooth client application for my mobile phone and I got stuck on device discovery.
My app can't discover any device, although in-built bluetooth app works fine. How can I make it work?
My code for device discovery:
localDevice = LocalDevice.getLocalDevice();
discoveryAgent = localDevice.getDiscoveryAgent();
discoveryAgent.startInquiry(DiscoveryAgent.GIAC,this);
modified on Sunday, February 27, 2011 1:50 PM
|
|
|
|
|
What you have done so far is initiate a search, which can take a long time. You have two ways to get the results:
1. write inquiryCompleted() in your DiscoveryListener implementation, and, when (or after) it is called, use discoveryAgent.retrieveDevices() to get an array of devices that have been discovered.
2. write deviceDiscovered() in your DiscoveryListener implementation, and, each time it is called, see if the device is what you are looking for.
I tried both ways (and they both work), but settled on #1 for production code.
Peter
If you like the answer, vote for it
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
Thank you for reply but I have these methods implemented. The problem is that my app can't find any device, though at least one - my laptop - is on and is discoverable. I can easily connect with it through in-built bluetooth app. Yet, another thing that puzzles me is why I can't get bluetooth address and friendly name from LocalDevice object. The only thing I get is empty string or null and my app suspends.
Well it seems that the problem is caused by my phone. I rebooted it, launched my app and it worked but only once. Anyway I think that this topic can be considered as closed.
|
|
|
|
|
In my experience, the phone's bluetooth manager can get totally confused if you do something it doesn't expect. The result is as you describe - reboot, your code works once (but the BT manager is locked up). I've found that you need to try and get "inside it's head" and imagine what state various BT internals might be in. Then avoid anything that might upset it. It took me a long time to develop code that could reliably switch the phone's BT connection back and forth between two external devices (PC, printer). Then when I tried it on a different brand of phone, I had to modify it again...
Peter
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
Hi,
Am trying to get celltowerinfo using C# and Windows Mobile 6 Pro in a Location based application. I get error message "cant find PInvoke DLL' ril.dll'
I thought this dll comes with Windows Mobile. Any Ideas how I can get the dll and reference it in my project coz am new in this area?
Also I need to use this info to track cab drivers using Google Maps. Do I have to deploy the dll in each of their cellphones?
Any help will be highly appreciated.
Eric
|
|
|
|
|
Eric Nzai wrote: I thought this dll comes with Windows Mobile
It depends on the manufacturer of the phone. Each OEM has a slightly different build of Windows Mobile - it's up to them to decide what components they include (via Platform Builder). The functionality of ril.dll is somewhere in the build but your manufacturer has obviously put it somewhere other than the standard DLL. Unless you contact the manufacturer, you're basically out of luck.
Judy
Be wary of strong drink. It can make you shoot at tax collectors - and miss.
Lazarus Long, "Time Enough For Love" by Robert A. Heinlein
|
|
|
|
|
Hi all
Can i run android .apk file in hidden mode?Please help me
|
|
|
|
|
What do you mean Hidden mode? If you want to create an application without a UI, you might try looking at a Service[^]
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
"Philosophy is a study that lets us be unhappy more intelligently."
-Anon.
|
|
|
|
|
Ok thanks for information
|
|
|
|
|
lol
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
|
hi
how to Mark and Pick all row number 1 on DataGrid when the form load ?
on Windows-mobile
thanks in advance
|
|
|
|
|
I want to upload a zip file in j2me to server for Lava mobile. The code works well for Nokia mobile but fails to upload file when used for Lava mobile reporting an error "CONTENT DISPOSITION or PREMATURE ENDING". Please help in sorting out this problem.
Thanks !
|
|
|
|
|
Hi,
I have been struggling to send sms using pdu mode in vb.net, My code is working fine for Text Mode, even I am sending sms from Hyperterminal with PDU command. When I try the same PDU in VB.Net code. The same is not working. I trying waiting for the port to respond. Used Thread.Sleep upto 10000ms but not succeed. Below is my code in VS 2005 (2.0 Framework)
Dim firstarg As Integer = Convert.ToInt32(pdudata.Substring(0, 2))
firstarg = firstarg * 2
tmp = pdudata.Substring(2)
tmp = tmp.Substring(firstarg)
firstarg = tmp.Length \ 2
port.WriteLine("atz" & vbCrLf)
port.WriteLine("ate0" & vbCrLf)
port.WriteLine("AT+CMGF=0" & vbCrLf)
read = New Byte(port.BytesToRead - 1) {}
port.Read(read, 0, read.Length)
'txtsms.Text += Encoding.ASCII.GetString(inbuf);
tmp = port.ReadExisting()
port.WriteLine("AT+CMGS=15" & vbCrLf)
Thread.Sleep(1000)
port.WriteLine("0021000C91190910153570000002E834" & Chr(26))
Thread.Sleep(5000)
port.DiscardOutBuffer()
'read = New Byte(port.BytesToRead - 1) {}
'port.Read(read, 0, read.Length)
I tried using msgbox and found that everything is going perfect except the last command i.e. 0021.... chr(26)
The given pdu is working in hyperterminal.
Can u figure out the problem for me.
Your solution will be highly appreciable as I am tired trying various combinations.
Thanking you in the meantime.
Jaidev Khatri
|
|
|
|
|
 This function worked for me. It sends a PDU message.
Private Sub PDUSMS()
If Comport = "" Then MsgBox("Please Choose A connection") : Return
smsPort.PortName = Comport
smsPort.BaudRate = "115200"
smsPort.Parity = Parity.None
smsPort.DataBits = 8
smsPort.StopBits = StopBits.One
smsPort.Handshake = Handshake.RequestToSend
smsPort.DtrEnable = True
smsPort.RtsEnable = True
smsPort.NewLine = vbCrLf
If Not (smsPort.IsOpen = True) Then
smsPort.Open()
End If
At_length = "17"
PDU_code = "079144772800800011000C914477529628010000AA03E8721E"
'smsPort.WriteLine("AT" & vbCrLf)
'System.Threading.Thread.Sleep(2000) 'Pause to allow last command to get to phone
smsPort.WriteLine("AT+CMGF=0" & vbCrLf) 'open space for new message
System.Threading.Thread.Sleep(2000) 'Pause to allow last command to get to phone
smsPort.WriteLine("AT+CSMS=0" & vbCrLf) 'open space for new message
System.Threading.Thread.Sleep(2000) 'Pause to allow last command to get to phone
smsPort.WriteLine("AT+CMGS=" + At_length + vbCrLf) '+ Chr(34) + At_length + Chr(34) +
System.Threading.Thread.Sleep(2000) 'Pause to allow last command to get to phone
smsPort.WriteLine(PDU_code + Chr(26)) 'number to send message to + vbCrLf +
System.Threading.Thread.Sleep(2000)
If smsPort.IsOpen = True Then
smsPort.Close()
End If
End Sub
|
|
|
|
|
I am doing project in c# for sending sms via AT commands using gsm modem having serial port RS232 to my cell phone. But this modem with serial port rs232 is very rarely used by people now a days. Can any one suggest me the better alternative for this but which can support the same AT commands that are supported by this modem. Any kind of help will be appreciated.
Thanks in advance.
Regards,
Aeman
|
|
|
|
|
hello guys...
Im trying to build a windows mobile application using visual studio 2008,windows mobile 6 using C# and sql server 2008.
all programs are on the same laptop.
I almost had everything right except i couldnt connect to the database through the pocket pc.
Here is what i've done so far:
SQL SERVER:
-I enabled tcp/ip connection -> cleared all dynamic ip adress and set the port to 1433. i also enabled the name pipes.
-I enable the sql port through windows firewall.(Control Panel->Security->allow aprogram through windows fire wall->add port
Visual Studio:
-New Project-> smart Device project-> device application
added in the form_load the following code:
string conStr = "Data source = Computer name\1433; intial catalog = "database name"; integrated security = true";
sqlConnection sqlCon = new sqlConnection(conStr);
sqlCon.Open();//this is where i get "SqlException"
I also tried the followin connection strings
i- conStr = "Data source = Computer name; intial catalog = "database name"; integrated security = true";
ii-conStr = "Data source = C:\\"path of the .sdf file on my computer";
iii- conStr = Data source = ip address\1433; intial catalog = "database name"; integrated security = true";
Device manager:
i installed virtual pc and windows mobile center;
openned device manager from visual studio, right click on pocket pc 5.0->Connect;
when connected i configured it to enable NE2000 PCMCIA adapter and use attached network card
i then cradel it and it connected well with the DMA.and in windows mobile center it showed connected.
now when i run the application(F5); i get an sqlException when openning the connection
this is a headache but i need a soluttion.
i have a some additional questions:
1- can i connect directly to sql server database engine and access the database(which isent compact).mdf file.
or cant i because pocket pc only connects to sql server compact edition database(.sdf)
2- Am i suppose to install sql compact on the pocket pc, when i run my application, i find it inside the pocket pc with the database and my application solution
3- is it impossible to connect to sql server 2008 directly through a windows mobile 6 . do i need a websrever, web service, replication, IIS....
im really stock at this point. i have no idea what to do or try next.
i'm findig it impossible connectin to sql server 2008.
PLease Helpppp!!!
thank you anyway..
|
|
|
|