How to hook api in windows phone 7? - windows-phone-7

Is there something allow me to develop a software in wp7 just like API MONITOR in windows?

Windows Phone has some native API hooks (although undocumeted):
http://blog.walshie.me/2010/11/12/windows-phone-7-native-apps-the-missing-link
However, due to the restrictive nature of the OS you might have problems in tracking down API calls from other applications, since you will need to have your own app running in the background, and that is currently the privilege given to system apps only.

Related

win32 libraries(dll) behavior in when launched from MetroApps

We wrote a COM in-proc Server(dll)(say x.dll) which is dynamically linking to a library(say y.dll) which is using win32 API's. We have observed a different behavior of the same win32 API when launched from windows8 Desktop Apps and Metro Apps.
When the COM in-proc Server dll(x.dll) is loaded from desktop Apps, all the win32 API in library(y.dll) are working fine.But when x.dll in launched from metroApps all the win32 API in y.dll are failing.
Is this the default behaviour for Windows8 win32 API ? It would be good if some one can provide me any documentation related to using win32 API in dll's which can be launched from both desktop and MetroApps.
Thank You
Only a subset of the Windows API is available to a Windows Store app. The MSDN documentation for each API function specifies whether the function may be called from a Desktop app or from a Windows Store app. For example, the following appears at the bottom of the documentation for GetProcAddress:
Minimum supported client Windows XP [desktop apps | Windows Store apps]
This function may be called from both Desktop apps and Windows Store apps. If a function does not say that it is supported in a Windows Store app, it may not be called from a Windows Store app. For example, LoadLibrary does not say that it is callable from a Windows Store app, so it cannot be called. (Note that while there are ways to call unsupported functions, doing so necessarily yields undefined behavior.)
Also note that Windows Store apps run with low privileges and have restricted access to the system.

Windows Phone 8 device management

I am asked to come up with a solution for remotely locking and blocking the camera of Windows Phone 8 devices. Also, I have to remotely wipe the data. I am new to Windows Phone development.
In addition, I have to get some device information and send this to a server periodically for tracking purposes.
Could you please provide some inputs?
Sorry, but there's no way lock or block the camera on a Windows Phone.
Also, an application can only access its own data, so there's no way to wipe all data on the phone. But you don't need an app for this specific need, as you can already do that using the integrated Find my phone service: http://www.windowsphone.com/en-US/How-to/wp8/basics/find-a-lost-phone
Windows Phone 8 also has management functions that can be controlled from a server, one of those functions is to wipe / block the phone. Watch the BUILD videos on Channel 9, its somewhere in there, may have been this video: http://channel9.msdn.com/Events/Build/2012/2-014
I would look into a Mobile Device Management provider such as Silverback (http://silverbackmdm.com/), or Zenprise (http://www.zenprise.com). Microsoft is also releasing an extension to Intune services in 2013 for MDM too.
The MDM providers allow the enforcement of device security policies, including thins such as remote wipe, password enforcement, etc. It's a great way to manage BYOD policies.

Windows Phone Test Framework by Expensify

Does the Windows Phone Test Framework by Expensify support testing on real mobile devices running windows phone 7 OS ?
If yes, which devices does it support? Please reply.
It depends what functionality you want to test.
The framework uses 3 different APIs to talk to the apps:
a COM API to talk to install/uninstall and start/stop apps
Silverlight automation peer support (communicated to using HTTP) to
talk to the silverlight controls within the apps - this allows get
and set of values, some list manipulation and inspection of the
visual tree.
Mouse and keyboard emulation to control the emulator
device - this is needed to do things like physical touches, hard
button presses (and other emulator interactions when the app isn't
running - e.g. taking photos).
For devices attached using USB: 1 and 2 are available
For devices attached using a network: 2 only is available
In summary, you can do some things if you want to... but I don't use the test framework to test real phones - I stick to the emulator. When external inputs (e.g. camera or gps) are needed then I find a way to mock them
according to the first few seconds of http://www.youtube.com/watch?v=2JkJfHZDd2g "there is some support for devices".
I would hope/expect all devices to devices to behave the same way, subject ot how they're configured.

desktop app (windows app) connect windows phone

is there a assembly or API to get isolated storage in windows phone using WPF or win form while connecting the windows phone device via USB?
please note the devise will be running offline so cannot use web service or WCF
thanks
Check out this article on emulator automation. It includes details of adding and removing files from isolated storage and should also work on an actual device as well as the emulator.
This isn't really a supported activity. I too have been thinking about what to do when you want a desktop version with extended features and you want the two to share data.
I think the key here is to think about how Microsoft achieves this with email and calendaring. There's no shared filesystem, rather Outlook on the desktop and Outlook on the phone both function as clients for the same Exchange server.
At one point I considered running a webservice in a desktop app so that the phone app could push data to the desktop app, but that would be a very manual process. The common-server model will provide a much better UX.
It's not an exact match to your situation, but a good tool is the Windows Phone 7 IsolatedStorage Explorer.
The reason I say it may not be the best match is this note from the documentation:
The WP7 Isolated Storage Explorer
supports connections from the emulator
or actual devices. For applications
running on devices a data connection
must be enabled (WiFi or the mobile
data connection).
It's at least a great start and keeps you from having to do the heavy lifting. Is there any reason you have to be offline and check the contents of IsolatedStorage? If you elaborate on why you have that requirement, we might be able to offer some work arounds.

Simulate user input with Windows Phone 7 Emulator

I've seen examples of using the Microsoft.Smartdevice.Connectivity.dll library to deploy WP7 applications to the emulator.
Is it possible to then automate user input to the device as well to perform UI testing of the application running in the emulator?
The emulator doesn't include support for this.
However, if you were using a UI test automation tool you may be able to simulate the clicks/UI interaction from a script runnign on the host PC.
I've never used a UI automation test tool with a VM/emulator but that's currently the only option available to you.
Unless you have a very complicated application it may be quicker and easier to test the UI manually though as a tool wouldn't be able to query the state of the app running in the emulator and so would only have limited usage.

Resources