Windows Phone local database changes listener - windows-phone

I am new to windows phone development and facing an issue. I want my application to act like a listener to any changes being made in local DB. If application is running and any change is made in the DB (e.g by background agent) then the foreground application should be notified right away.
Is there any way I could register some kind of event in my foreground application which is triggered when there is any change in the local DB?

Related

Get notified of VPN state change in OS X 10.11 and above

I have an app that uses a VPN. I can programmatically connect and disconnect from the VPN just fine and update the app's UI accordingly. I've recently noticed that the state of the VPN can change outside of my apps control and my app isn't notified of the state change and thus can't change the state of the UI to reflect the change. This leads to my app's UI being out of sync with the true state of the VPN. Is there a way my app can get notified of the state change?
NEVPNStatusDidChangeNotification is posted when the status of the VPN connection changes.

Check if process is running with VB.NET (Compact Framework 2.0)

I am working on an (console) application, which should be executed on startup and keeps running all the time in the background (executing something every 30 minutes).
How can I, in another (device) application, check if my console application is running (and start it if its not)?I am using VB.NET CF 2.0 and everything is being deployed on a device running WM 6.5
All the code examples I found where only available on the "standard" .NET.
There are several ways your "monitoring" app could work (and certainly more than I list here).
Use a named mutex (you'll have to P/Invoke it). The monitored app would create and hold it, and the monitoring app would periodically check to make sure it's held. If it's not held, the monitored app is no longer running.
Use the Toolhelp APIs. Have the monitoring app use the Toolhelp APIs to periodically enumerate the running processes. If the monitored app is not in the process list, it is not running.
Use a named event. The monitored app would have a background thread that periodically sets a named (watchdog) event. The monitoring app would wait on that event and if it fails to get the event in a certain time bound, the other app is either not running or has locked up.
Use a socket. Have the monitored app open a socket and listen on it. The monitor app would send a "ping" periodically to the monitored app. The monitored app would respond to the ping with an ack. If the monitoring app doesn't get an ack, the monitored app is either not running or is locked up
Use a window handle. The monitor app periodically P/Invokes GetWindow of FindWindow to find an always-present window in the monitored app - often by Form text. If the monitoring app can't find the Window, the monitored app is not running.

Uploading data when internet is available Compact Framework

I have an application that uses cellphone data connection to communicate with a remote server over web services. However, due to the unreliability of the cell phone network the application doesn't work for as long as the cell network is down. So what I want to do is change the application to process orders directly on the device and upload the orders in the background (like a windows service) when internet is available.
Here's what I'm thinking:
2 Applications
App #1: Change the order taking application to connect to internet at application load to get all settings and save to a sdf DB. Once settings are saved locally the user can process orders and save to database.
App #2: Runs in the background constantly checking db (say every 3-5 mins) for orders and upload to remote server via WCF web service. Additionally after upload is completed updated settings are downloaded back to the device.
App #2 is what I need guidance on. On a desktop I could run a windows service however compact framework of windows mobiles doesn't appear to have a windows service type support.
Any advice?
Why run it as a separate app? In that case you'll have to do cross-process synchronization of data access to make sure that simultaneous access from both processes doesn't cause a problem. Why not create a background "service" thread inside the app itself to do data forwarding to the enterprise?

Can iPhone app which runs in background send data over network to a remote server?

This application is location awareness app. It uses GPS details so it can be run in background. But is it possible to send the collected data to a remote server while the app is in background? or maybe when the screen is locked?
For Required background modes add App registers for location updates in plist, this will make application work in background and you can send location updates to server.
Here consider that your location services are not continuously on, else it will drain complete battery of device.
Hope this help you..

iOS Inter App Communication in Background

There is a platform application which connects to the remote server and stores required information in its local repository, that is in CoreData. I want to develop my application over this platform app. Since it is not possible to access its local storage, I have to communicate with it somehow. I am able to send/receive data using URL Schemes; however it's frustrating for user to switch between apps constantly.
Is it possible to communicate with another application via URL Schemes (or any other way) without bringing it to foreground?
With few exceptions, such as receiving CoreLocation data in the background or being notified to wake up by a local notification, it is not possible in iOS for an application to "run in the background"
This is a pretty common query on Stack Overflow, the official iOS reply can be found here
There are SO articles here and here.
Background data exchange is however not going to be a thing as there are restrictions on background app rules (so the URL transfer is going to foreground your second app)