Debugging by attaching a process for windows phone apps - c#

I'm currently running VS2013 Update 3, I'm building an app and i;m trying to mimic the Rate My App that shows up rate message dialog in b/w specified intervals.
My problem is that i've made a setting using ApplicationData.current.loclasettings and it is an integer.
and i want to see the settings number being updated every time i close and run the app to ensure the logic is perfect.
but i'm unable to do it. Every time i deploy the app from vs it replace the original app and thus erasing all the settings that have been previously saved.
I've tried to use attach a process but it doesnt work on windowsphones.

Well after a bit of research and going through the documentation it is clear that there is no way you can attach a process to the app that is already running on the phone.
At least for me there was no other way because Microsoft kept the USB debugging thing a little bit undocumented or not documented at all.
So, who ever are looking forward to first launch the app on a connected windows phone and then start the the connect to a process and select the appropriate device for communication , story it is not possible, at least the build that i;m using doesn't support. may there might be a better solution in the future.

Related

How do I programmatically set a a collection of default apps in Windows 10

Every time Windows 10 updates it resets a series of default apps to Microsoft defaults. I want my videos and music handled by VLC and my photos by Irfanview. The MS default will not even give me good previews. After manually resetting default apps a few dozen times I am willing to write an app that runs in the background and protects my defaults - I understand Microsoft makes this difficult - does anyone know how.
I tried the registry changes here http://winaero.com/blog/prevent-windows-10-from-resetting-your-default-apps/.
I tried Stop Resetting My Apps. I read this piece with a paragraph suggesting Microsoft will make this hard Windows 10 equivalent of LaunchAdvancedAssociationUI.
Does anyone have a solution - again I want something that can run in the background and set associations to my preferences not Microsoft's.
Although this post is over 5 years old, the SetUserFTA might help you.
See references here and here.
It worked for me to to programmatically set the default browser in Windows 10 and it should work for any other file types.
I wrapped it in a BAT file, which I scheduled via Task Scheduler and I can also execute on-demand. Make sure to run it with elevated (highest) permissions, from your user account.

Windows 10 uwp sticky background service?

I'm trying to convert an Android app to Windows 10 UWP. On android its easy: when boot completed, app service is started. It connects to controller over internet, fetches system state and all data (temp sensors, pumps, valves, etc) and keeps everything in memory. Foreground app can get data as soon as service gets them and display values, charts realtime. After closing foreground app, service keeps working, I still have all system state and I can play alarm sound if needed.
Is it possible to do [almost] same functionality on Windows 10 uwp?
I cannot find a way to start service with windows. Service started with foreground app is stopped when foreground app is closed. SocketBackgroundTask keeps connection perfect, but system state is lost with service.
Should I save system state to file and analyze all data after each renew? Data flow varies from once in 10 minutes to ~10 per second.
Or should I forget Windows 10 as limited platform?
I am designing a similar piece of sensor control software, and I have found UWP/Win10 to be limiting. We ultimately resorted to using Assigned Access to keep the app permanently in the foreground.
Assigned Access
Assigned access assigns an app to an account. So when Mr. Bob logs in, the app starts full-screen, and it cannot be closed, and if it crashes, it is restarted.
Note that the only way to access other parts of the system is to hit ALT-CTRL-DEL and log in as a different user. That might be bad for some, but if you have critical process monitoring going on, then it's probably a good thing that the user can't mess about with the system or quit the app.
It's also quite simple to implement, you only need to add a declaration to the app manifest, and you need Win10 Pro or Higher.
Windows IoT
You could also look at Windows 10 IoT, when you deploy an app to it, it does pretty much the same thing. However the range of hardware is quite limited, and many of them aren't fully functional yet - RPi suffers from SDcards being inherently unreliable, and lack of graphics acceleration. Dragonboard lacks driver support for resolutions other than 720p, etc. https://developer.qualcomm.com/forum/qdn-forums/hardware/iot-development-platform/29652
Extended Execution
In addition we have experimented with using extended execution, which lets the app run in minimised state, potentially indefinitely. I have mixed feelings about it. Although the app will keep running most of the time, but if the OS is struggling for resources, the app will get suspended and won't be restarted until the user switches back to it.

Minimize Windows 8 Store App while tracking location with GPS

I'm working on a metro app and am having trouble finding how not to show the application.
We recently deployed tablets to our field reps, and need to add gps tracking. GPS is much easier to deal with in the metro libs (it's like 4 lines of code vs. unmanaged) so we're hoping to be able to push a metro app instead of spending time coding a winforms/wpf desktop app (the tablets are full version windows, so it's an option if we can't hide a metro app. I feel like it should be possible though as the start screen tiles update automatically without opening the main program).
In WPF, it's fairly simple to make a window invisible. I'm creating the metro app in wpf, but it uses different libs than desktop and I may just not know how to do it.
In desktop programs, it's fairly simple. You do something along the lines of:
<Page
x:Class = xxxxxxxx
..
Visibility="Hidden">
Unfortunately, with metro, the only options I have are collapsed and visible. Collapsed doesn't seem to have any effect, unless it's just because it's not deployed and visual studio shows it anyway...
So basically I'm trying to figure out if there's a way to start the program minimized or hidden so that it doesn't interrupt the field reps every time it takes their location.
If you really want to make a metro app and want it to run "minimised" you will need to look at background task. To start the background task the user would still need to start the app at least once, futhermore background task have limitation how how often and how long they can run. Also there is a lot of constraint on deploying a windows store app if you cannot publish it in the store.
If your goal is to just have access to GPS through C# apis, the GPS is actually one of the winRT api you can use from the desktop, you can find a tutorial on how to access winRT api from the desktop here
Here is the complete list of winRT api accessible from the desktop (You can find Geoposition class among them).
Have you looked into creating a background task that transmits GPS? The background task can run without the app running.
I am not entirely certain you can voluntarily minimize a Windows Store App on a user's behalf. I see nothing in IntelliSense about it, nor have I found anything online or see any app do it.
However, be aware that deploying the app without using the Windows Store -- sideloading -- requires Windows 8 Enterprise edition computers joined to the domain OR Windows 8 Pro with a sideloading key ($30 per key, purchased in packs of at least 100.) Perhaps a WPF app with unmanaged code is worth the money and effort.

Windows embedded 2009 service

I'm developing an application that will be executed in a ThinClient with Windows Embedded 2009. It's written in C# 3.5. But, when I played for the first time with the ThinClient, I noticed that it has a lot of features disabled.
For example, there is no MyPc, or I can't have access to it.
So, my app needs to run when the client is turned on, but I can't find a service manager in embedded 2009.
Is there a way to make my app run every time the client is turned on?, I thought about a service, with automatic start. Can this be done like a windows service with no problems?
And another thing. My app also has to shut down the client. I've found a way to make it, but, I'd like to know if is different in Wndows Embedded.
Btw, the device has no hard disk.
Any other suggestion, will be very appreciated.
Have a nice day.
In the older Embedded there is a "startup"-folder (located on the flash-card containing the win-image)

Monitoring Framework needed

I'm building a big application with a lot of modules, i want to monitor them. Every module has its own different parameters that I'm interested in, ranging from performance, to logical statuses of components.
Eventually i need to concentrate all this information, and to be able to display it. Is there a framework i can use to achieve this? im using .net 3.5
You could try Munin. Once you install it - you simply write some plugins - small programs that will grab values from your application. And print them to command line in the form of values and labels. For example:
NoRDNS.value 10
Breakin.value 1
LogPassPAM.value 0
NoID.value 0
LogPass.value 100
InvUsr.value 23
LogKey.value 0
RootAttempt.value 0
Floats are OK too.
Munin will call the plugins periodically (every 10 minutes by default) and plot beautiful PNG graphs over time, track the min/max/average info, and organize everything in static HTML pages.
For you, probably the biggest problem with Munin would be setting it up on Windows. I never tried it on Windows - for me it works on Linux. Fortunately official website does have some options for Windows - in particular the munin-node-win32 program. You would need it.
Unfortunately, munin-node-win32 will only collect the data. To store (as RDD) and render the graphs (as PNG) you would need the Munin server. That can run locally or remotely. For running it locally, Cygwing may be and option but a sure way it to setups a virtual machine (see QUEMU or VirtualBox) running a simple setup of Ubuntu or Debian. In there, setting-up the Munin server is very easy - simply, run:
sudo aptitude install munin
and edit /etc/munin/munin.conf - placing the local IP address of the host where your application and munin-node are running. You don't even need to restart anything - Munin will be already configured in CRON so it will read the config file and do its job every 10 minutes as long as the VM is running. Just in case something goes wrong - the logs will be in the usual /var/log folder.
It looks pretty involved but it's easier than writing your own monitoring and graphing framework. I have a close relative who re-invented the wheel and wrote a monitoring/plotting system from scratch in .NET but I would trust Munin much more than his code.
At the end of the day you would point your web-browser to a private network IP address of the VM and get a nice performance report that looks like this.
Try wolfpack.codeplex.com - .net windows service based monitoring framework - fully extensible & ships with loads of plugins!
Provides passive monitoring (polling for data) and active - you app can pump data/kpis/stats into wolfpack. It also provides a geckoboard data api so you can get rich business dashboards in an instant.
PS: I wrote wolfpack!
You can use appfirst product. They have a way of discovering network flow and display what you described. This might solve your question.

Categories

Resources