How to find application's starting and closing time-stamp in blackberry? - blackberry

I need to get the any application starting and closing time in Blackberry. How could I do so?

Related

What is best practice to constantly receive coordinates

I am kind of new to programming and wanted to know what would be the best way to get data from server? To be more specific my app receives GPS coordinates from server (currently using Alamofire) and then shows them on the map.
Now, I don't know how keep those coordinates updated on device. Should I make loop, where app downloads coordinates from server, let's say, every 5 seconds and shows them on the map? Should loop interval be longer? Ideally I would like if an app could show live location - that is get updates from server every second.
Maybe there is library for my specific problem? Where could I read more about this?
And I could upload some of my code, but now it simply get data inviewDidLoad using Alamofire and show it on map.
EDIT: Why do I keep getting down votes? Seriuosly, I would like to know what I did wrong.
Best way is to use socket programming and listen particular socket where coordinates will be pushed from server. Rather than pulling periodically this will be push mechanism where server will push from it's side whenever it has new coordinate available ...
Here is the Apple's guide line for the same
https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/NetworkingTopics/Articles/UsingSocketsandSocketStreams.html#//apple_ref/doc/uid/CH73-SW4
If this seems like too much you can use pubnub library for ios which is free for 100 devices
Here is the link
https://www.pubnub.com/

Get the process id of ShellExecute

I have been searching all day to find a solution to this problem.
I have 2 Excel instances (2 times launched) and in one a batch process is running to create a pdf file. If I use ShellExecute to start the conversion then the focus is not switched to the called application and the user can continue in the other excel application without interuptions.
There is altough a problem, the ShellExecute does not wait and so this is runing square. I tryed with ShellExecuteEx with the nescessary options set but this steals the focus anyhow. So my only chance is ShellExecute but I should be able to get the id of the process created so I can wait until ended. A long explaination but I found it nescessary. Who can help me here ?

My Application's main method does not work after pulling battery from Blackberry device [duplicate]

This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
How to setup alternate entry point in Blackberry application?
I have made a blackberry application which need to run automatically after phone reboot (by pulling battery), when i pull the battery from phone and insert it again then i check from log file which I created on phone memory. By observing the log I found my Application's main method does not call after restarting.What can be the reason?
i think this question does not make any sense. After diagnosing we found that every thing was working fine, but the only problem was that, after restarting (by pulling battery) it takes some time to initialize memory card, and my db and log file is stored on memory card. After detection of problem i shifted my log file to phone memory and i found every thing was OK. Now i put some delay on the stating of application, every thing is working fine as required.

The way to programatically distinguish between system process and the process launched by the user(for example,game process)

How to programatically distinguish between system process and the process launched by the user(for example,game process)?
I have to solve a similar problem and am getting the process list in basically the same way as here: Can I use `sysctl` to retrieve a process list with the user?. I am getting the current user ID by finding the process that matches my current app name, and then throwing out all the processes that have a different user ID. That seems to get rid of about 1/2 of the system processes.
Throwing out any process with a pid less than 100 seems to get rid of nearly all the other system processes, and what I'm left with looks pretty good. There are still a few system processes left, and I think I'm going to just ignore them by name. (Though I'm not sure if they are only there because I'm debugging on my phone.)

hook into a file, read new content in real time

How would I hook into a file that's currently in use by another program, which constantly writes out to it? Let's say, there's a text file with 10 lines. When I start my app it has to detect and read any content from there on everytime the writing program saves its content. Can this be done without a constant check on the filesize/date?
You could monitor the folder for changes using the ReadDirectoryChangesW API.
Keep track of the last position you read to, and when you receive a change notification for that file, read from there to the end of the file (as it currently stands).
An example of how to use the ReadDirectoryChangesW API is here:
Why does ReadDirectoryChangesW omit events?
Kinda similar to this:
Monitor files similar to System Internal's/Microsoft's FileMon/Process Monitor

Resources