XDA and SMS programming - Windows Mobile Development and Hacking General

Hello,
I'm new in the wonderful world of XDA and Pocket PC 2002, and I would like to use SMS in a new application. Do you know how I could see example of source code using SMS API? Or do you have such example to help me?
Thanx
Gizmo

Precision
I forget something important : I'm using eMbedded Visual C++ 3.0!!
Thanx
Gizmo

All you have to do is include SMS.H in your code and linkt to SMS.LIB, see online documentation for more details. Below a simple function which takes a phone number in international format (+491715555555) and the message as parameters ...
Code:
BOOL SendSMS(LPCTSTR pszNumber, LPCTSTR pszMessage)
{
SMS_HANDLE hSMS;
HANDLE hGlobalReadSMSEvent;
HRESULT hResult;
hResult= SmsOpen(SMS_MSGTYPE_TEXT, SMS_MODE_SEND, &hSMS, &hGlobalReadSMSEvent);
if(hResult != S_OK)
{
AfxMessageBox(_T("Couldn't open the SMS function"));
return FALSE;
}
SMS_ADDRESS smsaDestinationAddress;
smsaDestinationAddress.smsatAddressType= SMSAT_INTERNATIONAL;
wcscpy(smsaDestinationAddress.ptsAddress, pszNumber);
TEXT_PROVIDER_SPECIFIC_DATA tpsd;
tpsd.dwMessageOptions = PS_MESSAGE_OPTION_NONE;
tpsd.psMessageClass = PS_MESSAGE_CLASS3;
tpsd.psReplaceOption = PSRO_NONE;
hResult= SmsSendMessage(hSMS, NULL, &smsaDestinationAddress, NULL, (BYTE*)pszMessage,
wcslen(pszMessage)*sizeof(WCHAR), (BYTE*)(&tpsd), sizeof(tpsd), SMSDE_OPTIMAL, SMS_OPTION_DELIVERY_NONE, NULL);
if(hResult != S_OK)
{
AfxMessageBox(_T("Couldn't send the SMS"));
return FALSE;
}
hResult = SmsClose(hSMS);
if(hResult != S_OK)
{
AfxMessageBox(_T("Couldn't close the SMS function"));
return FALSE;
}
AfxMessageBox (_T("SMS has been send"));
return TRUE;
}

Thanx
Thanx! Thanx!
I made a big mistake : I forgot to link the SMS.LIB....
I'm a beginner!! (and I'm French : I'm sorry for the bad english language!)
Have a great week!
Gizmo

Hello,
Does anybody has a code example for receiving SMS messages?
I've trying to do so for two weeks, and I'm completely lost.
I've read in this site it can't be done with SmsReadMessage or SimReadMessage. Is it correct? What have I to do, using RIL? Or can I use POOM?
Any help would be very appreciated.
APallares

Have you seen tstril? It shows a good way of handling incoming SMSs.
It's here http://xda-developers.com/RIL/

Yes, I've took a look at tstrill. But this example only shows notifications on what's happening on the SMS channels. It has't any reference to the RIL_ReadMsg.
I've searched on the patent documentation, and I have found this help on the RIL_ReadMsg function:
HRESULT RIL_ReadMsg(HRIL hRil, DWORD dwIndex)
Reads a message from the current storage Location
Parameters:
hRil: handle to RIL instance returned by RIL_Initialize
dwIndex:
index of the message to be read
Comments:
Asynchronous. lpData points to an RILMESSAGEINFO structure
My question is: How do I access to lpData?
What I want to do is a function on a DLL like this (in pseudo-code):
BOOL WINAPI ReadSMSMessage(int numMens, LPTSTR Message){
RIL_Initialize
RIL_ReadMessage
RIL_DeInitialize
}
But, what I have to do to get access to "lpData"?
Thanks,
APallares

SMS.LIB
Have the sms.lib now. Normaly it's delivered with dthe EVC - but the 2 Versions I've got doesn't have it. Get them now by eMail
Maybee, this is the super-beginner-question - sorry
I'm searching for the SMS.lib and SMS.h . Working with MS EVC++ 3.0.
Every time, if I try to compile, I get the message, that the files couldn't been found.
Thougt to get them from the internet - but found them nowhere.
I'm happy about every tip (excluding "you're stupid" ;o)
Greetings from hannovre,
Andreas )
[/b]

Look in ProgramFiles / Windows CE Tools / WCE420 / PocketPC2002 / LIB / Armv4 / all your libraries should be stored there ... in ur code FILE VIEW , Source Files, right click and select add Files to Folder and add your lib
else just #inclde "<the full lib path>"

@nutitija
You are aware of the fact that this thread is more than two years old
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Sascha

poor guy could still be waiting for an answer ....

Related

getting the cell id on HTC Alpine

Hi all,
Thanks to itsme's code here, i managed to get the RIL functions working:
Getting signal strength etc... works, however, RIL_GetCellTowerInfo() doesn't.
So I tried through AT-commands, as shown by itsme's second piece of code here. The AT commands, given through the RIL_DevSpecific() command seem to work, they give me a result callback. However, lpData points out to be 0 after a "at+creg=2"(26) in this reply? Shouldn't it point me to a celltowerinfo structure or an array of some kind like RIL_GetCellTowerInfo() does?
Calling RIL_GetCellTowerInfo() after issuing the AT-commands still gives me an error reply.
Is there anyone with experience on this subject, or who has succeeded in this on the Alpine with Windows Mobile 2003 SE? I've been on this for a few days now, any help would be much appreciated. Could it be that it just isn't supported? And in that case, is there another way of getting the Cell ID? Source snippet attached.
Kind Regards,
xgmorkx
The fnGetCell function from this post seems to do the trick! Gonna walk some blocks now to see if it changes
try this one:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
files to download:
MDA AT
mdaatcom.dll
mdaGetCellDll.dll
Homepage:
http://develop.ipeng.de
more info on->
http://www.spv-developers.com/forum/showthread.php?t=229[/url]
will this work on a blue angel?
Sample App to get cell id
I tried to download the tsril.cpp and make a project to work on my iPaq Pocket Pc Phone edition, but the ril.lib I have must be bad. The compile shows the following link errors:
CellRill.obj : error LNK2019: unresolved external symbol _RIL_DevSpecific referenced in function "bool __cdecl EnableCellBroadcasts(bool)" ([email protected]@[email protected])
CellRill.obj : error LNK2019: unresolved external symbol _RIL_GetCellTowerInfo referenced in function "bool __cdecl RequestCellTowerInfo(void)" ([email protected]@YA_NXZ)
CellRill.obj : error LNK2019: unresolved external symbol _RIL_Initialize referenced in function "unsigned long __cdecl DoRIL(void *)" ([email protected]@[email protected])
emulatorDbg/CellRil.exe : fatal error LNK1120: 3 unresolved externals
please help
:roll:
WIN32 mode
I got past the link problems and run the code, I print out the errors using DoError function contained in the tsril.cpp sample code.
It tells me that the following functions are only availiable in WIN32 mode ?
EnableCellID
RequestCellTowerInfo
Any ideas what this means and how to get around it, I need to get this Cell ID.

Time after the last soft reset ?

hi,
is possible to know the time that has happened from last soft reset?
thank's
You want to query the uptime.
V
what ?
(i have a qtek s100 with w2003se not linux)
i have searched "update" program and don't have any result.
i have tried to execute a program called "update" but not exists...
If you mean the uptime, time since softreset, it is obtained using 'GetTickCount'.
An example of a program displaying this info is here:
V
ah!
uptime is an external application and is not in my pocket by default. !!
sorry, i didn't not undersatand that....
i find this application at google....
thank's !!
Not sure if it did, but I hope it helped!
V
I'm very agree to you !
please, give to me the fullname of the application what are you using
thank's
bartito, if you click on the picture it will take you there.
http://www.geocities.com/tomgigear77/Software.htmlhttp://www.geocities.com/tomgigear77/Software.html
BatMemTime
V
oks,
thank you very much !!
Another application able to count uptime/time from last reset/battery level log is here. It's Today plugin.
hello,
but i don't need / want / love a today plugin.
i need a user executable program (not memory resident).
regards
bartito: this is posted in the development section. Are you a programmer? It can be coded in about 4 lines (probably less) if all you want is time since you booted.
I can give it a go, but I'm incredibly and increasingly busy, so if you find another app, please let us know. If you're not a coder, it's probably a good excuse to start learning! It's nice to have a good reason and then give yourself this power...
V
hi vijay555,
i'm a pc programmer. i'm informatic enginneer; but i have programmed onyl in c, c++, pascal, perl, vbasic... and never applications for pocket.
i'm interested on that, but i don't have information about the language, compiler, etc....
send to me the title of a book and the name of a compiler, please.
other question: exists a development environment (type borland c++ builder)??
thank's
bartito, you're more than experienced! I've only just started learning c++, but for PPC, I wrote down some tools you might need etc:
http://forum.xda-developers.com/viewtopic.php?t=37884&highlight=vijay555
V
Uptime:
VJEschaton
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
V
Hi,
Finally I have programmed a small code with MortScript.
I send...
The file
\Windows\Startup\set-uptime.mscr contains the next code:
***************************
GetTime time
RegWriteDWord "HKLM", "System", "Uptime", %time%
***************************
the file
\ProgramFiles\Utilities\get-uptime.mscr contains the next code:
***************************
GetTime time
RegReadDWord "HKLM", "System", "Uptime", stime
Set stime, %time% - %stime%
Set days, ""
Set hours, ""
Set minutes, ""
If (%stime% / 86400 > 0)
Set days, %stime% / 86400 & " días"
Endif
Set stime, %stime% MOD 86400
If (%stime% / 3600 > 0)
Set hours, %stime% / 3600 & " horas"
Endif
Set stime, %stime% MOD 3600
If (%stime% / 60 > 0)
Set minutes, %stime% / 60 & " minutos"
Endif
Set message, %days%
If (%hours% ne "")
If (%message% ne "")
Set message, %message% & ", " & %hours%
Else
Set message, %hours%
Endif
Endif
If (%minutes% ne "")
If (%message% ne "")
Set message, %message% & ", " & %minutes%
Else
Set message, %minutes%
Endif
Endif
Message { "El tiempo transcurrido desde el último soft reset es de " & %message% }, "upTime"
***************************
The first source saves the time at the startup, and the second file shows the difference intra the startup time and the actually...
Regards
Good stuff!
V

[UPDATED] [Open Source] HTCustom Tweak Application [Reg & XML Loader]

HTCustom v1.0 CUSTEL & Shadowmite Collaboration
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Whats Good?
- Thin Scroll Bars
- Short Scroll Arrows
- Live Searches Via Google
- Remove battery/comm manager from tray
- Clock Display (clock, date, nothing, both, battery)
- Enable Time Zones
- 3g video dialer
- enable dtmf support
- disable in call volume beep
- gprs/3g disconnect/timer
- connection always on
- disable sms sent notifier
- change bt name
- transfer files via bt/irda
- improve a2dp sound
- Disable menu animations
- modify glyphcache
- enable file system cache
- modify FATFS & file system filter cache
- pie card cache device/sd
- navigate pie w/ dpad
- Hermes Keypad Layout
- Show/Hide Sim contacts
- Disable Security warning
- Mount Ext Rom
- enable/disable hsdpa
- xml/provxml loader
Keyboard tab is HTC Hermes Specific
As stated the application is open source so anyone can contribute to it. If you find any bugs please report here.
Can't install it...need a newer version of .NET Compact Framework...I'll download v2.0 and give it another try.
Great app
Can you please add the functionality of being able to specify a directory and install all of the CABs contained within it?
Code:
public void ProcessCABsDir(string sourcedir)
{
// Install CAB's
try
{
DirectoryInfo dir = new DirectoryInfo(sourcedir);
foreach (FileInfo files in dir.GetFiles("*.CAB"))
{
Process inst = Process.Start(sourcedir + "\\" + files.Name, "");
inst.WaitForExit();
}
}
catch
{
MessageBox.Show(
"Some files were not installed",
"Error:",
MessageBoxButtons.OK,
MessageBoxIcon.Exclamation,
MessageBoxDefaultButton.Button1
);
}
//End of CAB's
}
You could then place this in the ExtROM and get to execute on hardreset.
Happy to work with you on this one.
That is an excellent idea and I'm certainly planning to implement that in the near future!
Shadowmite said:
Sorry, you're gonna have to provide a link, this noob can't find anything in the wiki about a 802.11g router anything for the Hermes, there is ONE link to wifi from the hermes wiki and it talks about what it is... Nothing more.
In the meantime, release HTCustom 1.1...
Code:
New: Now contains mass cab installer (select the folder and let it run)
End of call beep edit...
Click to expand...
Click to collapse
updated...
Good work
Now how about making it part of the ExtROM of a ROM the the app get launched follwoing a hardreset?
The same idea as the autorun.exe HTC provide in all operator devices?
May I know whether this application requires .Net CF 2 to run? Don't wish to install it on my precious main memory..
It does...
doedoe said:
Good work
Now how about making it part of the ExtROM of a ROM the the app get launched follwoing a hardreset?
The same idea as the autorun.exe HTC provide in all operator devices?
Click to expand...
Click to collapse
I could, but don't most users like to customize when they are ready? Maybe just a popup that explains how it works so they know and can launch it when ready?
Good Works
Why not to integrate into this tweaker, the possibility of closing definitively the programs with the touch OK? It allows among others to use a TyTN with only touches and keyboard. Today, the touch OK reduces them
At the moment I found only another tweaker which makes it (PQzII), but that would be practical to use only one

[APP][1.6+] KeyEvent Display v0.0.4

Description
Once, I was playing with a number of Chinese tablets and trying different ROMs on them as they are technically the same hardware (HSG X5A variants).
I've had some problems getting the hard buttons to work though, so I wrote this application to detect key events and print them out. It will print out the following:
KeyEvents: The KeyEvents as Android understands them (KeyUp, KeyDown, KeyLongPress, KeyMultiple)
LogCat: Any relevant messages in logcat. Its filtered based on keywords declared in arrays.xml
Kernel: Any relevant messages in the kernel log. Its filtered based on keywords declared in arrays.xml. Kernel log parsing needs root.
The three checkboxes at the top control what information will be displayed.
This is a personal debug tool, but I hope it will be of some use to someone else.
No Ads.
Notes
While the application is running, the only "hard" keys which should work is "Home" and power. All others will produce their keycodes.
The SU request is to read the kernel log, so I can check if any keyevents are thrown by the kernel.
The location of keylayout files in Android is /system/usr/keylayout.
Kernel log parsing needs root
Both logcat and kernel log monitoring will only display lines containing words from two arrays in arrays.xml (i.e. you need to recompile the app to change them at the moment)
Currently the filters are:
Logcat:
HwGPIOE->GPDA
keycode
keycharacter
Kernel:
HwGPIOE->GPDA
keycode
keycharacter
Permissions
READ_LOGS: Used to access the Logcat log.
WRITE_EXTERNAL_STORAGE: Used to write the exported data to the SD card.
Changelog
v0.0.1: First public release.
v0.0.2: Improved stability, added Exit button.
v0.0.3: Code updates.
v0.0.4: Changed drawables, added sharing, added more info in export text
Acknowledgements
Original icon by OCAL (http://www.clker.com/clipart-style-paintbrush.html).
Licence
Licensed under the Apache Licence 2.0: http://www.apache.org/licenses/LICENSE-2.0.txt
Links
Market link: https://market.android.com/details?id=aws.apps.keyeventdisplay
Webpage: http://aschillings.co.uk/html/keyevent_display.html
Github: https://github.com/alt236/KeyEvent-Display---Android
Screenshots
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
|
This could be handy for anyone trying to redesign an apple BT keyboard for use with Android.

My phone storage is negative?!

I'm using a2017u b27
Just found this problem few minutes ago:crying:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Do you guys have this problem too? And how to fix it.....
Try wiping your cache, that number looks to be wrong. Click on cached data and it'll give you the option.
cho9736 said:
I'm using a2017u b27
Just found this problem few minutes ago:crying:
Do you guys have this problem too? And how to fix it.....
Click to expand...
Click to collapse
Holy crap that's some serious integer overflow.
I'm experiencing the same problem
Screenshot attached.
The problem arose when I installed first official LOS and persist to the latest 0410.
The cache has been cleaned multiple times.
The funny thing is, that every file manager installed shows the correct size
Any solution to this?
This is just a bug in lineage os. It doesn't affect your actual storage space.
The problem happens I if you exceed 64 gb and if you boot the phone with a SD card. Remove the SD card, then boot the phone, once switched on check the storage the number should be right. Insert SD card once the phone is switched on.
Unfortunately restarting will reset the negative storage number.
hboa said:
I'm experiencing the same problem
Screenshot attached.
The problem arose when I installed first official LOS and persist to the latest 0410.
The cache has been cleaned multiple times.
The funny thing is, that every file manager installed shows the correct size
Any solution to this?
Click to expand...
Click to collapse
That is because you have MMC inserted while booting. This issue is commonly seen on Android devices running Android 7 nogaut.
If you have AOSP for Android 7 then modify the below file:
/frameworks/base/core/java/android/os/storage/StorageManager.java
Change the interchange the position of mmc and sda storage path
private static final String[] INTERNAL_STORAGE_SIZE_PATHS = {
"/sys/block/mmcblk0/size",
"/sys/block/sda/size"
};
private static final String[] INTERNAL_STORAGE_SIZE_PATHS = {
"/sys/block/sda/size",
"/sys/block/mmcblk0/size"
};
ronakpatel1311 said:
That is because you have MMC inserted while booting. This issue is commonly seen on Android devices running Android 7 nogaut.
If you have AOSP for Android 7 then modify the below file:
/frameworks/base/core/java/android/os/storage/StorageManager.java
Change the interchange the position of mmc and sda storage path
private static final String[] INTERNAL_STORAGE_SIZE_PATHS = {
"/sys/block/mmcblk0/size",
"/sys/block/sda/size"
};
private static final String[] INTERNAL_STORAGE_SIZE_PATHS = {
"/sys/block/sda/size",
"/sys/block/mmcblk0/size"
};
Click to expand...
Click to collapse
Isn't there any way to push this fix as a commit or whatever that is called? This has happened on every ROM I've used and it was a little weird having 8 gigs of internal storage
There is a fix for this I know because I pushed it to Candy quite a bit ago.. Could've sworn Los had merged it as well
ronakpatel1311 said:
That is because you have MMC inserted while booting. This issue is commonly seen on Android devices running Android 7 nogaut.
If you have AOSP for Android 7 then modify the below file:
/frameworks/base/core/java/android/os/storage/StorageManager.java
Change the interchange the position of mmc and sda storage path
private static final String[] INTERNAL_STORAGE_SIZE_PATHS = {
"/sys/block/mmcblk0/size",
"/sys/block/sda/size"
};
private static final String[] INTERNAL_STORAGE_SIZE_PATHS = {
"/sys/block/sda/size",
"/sys/block/mmcblk0/size"
};
Click to expand...
Click to collapse
I don't see /frameworks/ folder on my root directory......
i experienced the same problem after installing twrp, i solved it by wiping the internal storage (without reset)

Categories

Resources