Application get crashes when i another application is accessing the file
Hi Everyone,
I have written an application which is taking gps location in every 30 sec and write it in a file(this is written in symbian c++).some times my application gets crashes when another java application is also running and reading the same file.my code never crashes when it is running alone it only crashes when i start java app.
as per my thinking it wouldbe the synchronization cause may be java app is reading the file and i am writing in file. I dont have much experience what is the reason of crashing and how to solve it you people are having experience kindly guide me to solve this bug.
Re: Application get crashes when i another application is accessing the file
[QUOTE=amit.mangal;685522]Hi Everyone,
I have written an application which is taking gps location in every 30 sec and write it in a file(this is written in symbian c++).some times my application gets crashes when another java application is also running and reading the same file.my code never crashes when it is running alone it only crashes when i start java app.
as per my thinking it wouldbe the synchronization cause may be java app is reading the file and i am writing in file. I dont have much experience what is the reason of crashing and how to solve it you people are having experience kindly guide me to solve this bug.[/QUOTE]
You need to open the file in Sharing mode.
Re: Application get crashes when i another application is accessing the file
already i did it EFileShareAny
Re: Application get crashes when i another application is accessing the file
[QUOTE=amit.mangal;685532]already i did it EFileShareAny[/QUOTE]
In Java i think u do not open the file in Share mode. And how you synchronize both Symbian and J2ME application?
Re: Application get crashes when i another application is accessing the file
can we use semaphore to synchronize the file if symbian c++ app accessing the file then java app do not access and if java app is using the file then symbian c++ should not access
Re: Application get crashes when i another application is accessing the file
[QUOTE=amit.mangal;685539]can we use semaphore to synchronize the file if symbian c++ app accessing the file then java app do not access and if java app is using the file then symbian c++ should not access[/QUOTE]
If you want to make communication betwwn Java and Symbian App, use MIDletNativeServicesFramework.
[url]http://wiki.forum.nokia.com/index.php/MIDletNativeServicesFramework[/url]
Through this you can communicate easily.