Losing control while testing in Xamarin test cloud - xamarin-test-cloud

After entering into phonebook or gmail or playing YouTube through the testing application, I am losing all the controls to test or query. As soon as it comes into play I lose control. Then I have to manually deal with it. On writing tree on Repl mode I am not able to see anything.

This is because you are leaving the application. Xamarin UITest works by running a client-side server next to or inside the mobile application. the client-side server is what enables us to interact with controls and query for things on the screen.
If you are on iOS, you have to have the Calabash agent installed in the application to make things work. Once you leave the application (switching to YouTube or other app), the client-side server is backgrounded and won't be able to do anything because of how iOS operating system is designed.
On Android, it depends on what version of Android you are using. Older Android versions don't sand box apps the same. Android 6.0 and above have more security controls and I wouldn't expect this behavior to work.
If you are trying to test if those things work, You should be testing that the Intent you are sending is correct. You are really testing the operating system at this point because you are verifying that YouTube or whatever did what you expected. Really we should have a base assumption that when we provide the phonebook with the proper intent, the operating system should behave accordingly. If you test that the video actually opens in the YouTube app, you are now testing if YouTube can open their links/intents successfully. Some people decide to test these things, many find that it is redundant and increases their teams cycle time.
I hope this helps!
Disclosure: I work at Xamarin/Microsoft

Related

All converted apps including samples fail to run with a 'The parameter is incorrect'

I'm trying to convert a WPF oneclick installed application and so everything should be pretty straight forward. However, whenever I run the debug project, I get
'The parameter is incorrect'
in a message box popup and I can never run the app.
This happens for my app while trying to debug, all the samples from github, and even the DAC application from the Windows Store. The error pops up even once the app is installed and showing in my application list.
I'm on the latest build of the Creators Update.
There are various errors in the event viewers, but they seem to be a common occurence for WinRT apps.
Any ideas at all?
If you have the WPF project in VS2017, I'd recommend to package directly from VS without using the DAC. see the article for more information https://learn.microsoft.com/en-us/windows/uwp/porting/desktop-to-uwp-packaging-dot-net
The problem appears to be related to the May Security Update. I restored Windows to the factory defaults and everything works fine.
However, once I install the the May Security Update to address this bug with Sql Server and Filestreams, the Desktop Bridge Debugging project stops working.
I'm going to throw out a random guess that it's related to the Microsoft Malicious Software Removal Tool, as the event viewer logs mentioned an issue with the 'parameter is incorrect' referring to the Microsoft.MRT.
Of course it could be anything, and as only 7500 people have even downloaded the Desktop Bridge Debugging project in the first place, I doubt it's high on the list of Microsoft Developer Priorities.
And to be completely honest, it's really probably my fault for not rewriting the app as a UWP app, after rewriting it as a Windows Forms app, and as a Silverlight app, and as a WPF app and on and on and on. Although, I'm not sure how many glasses of Kool Aid are left in the punch bowl for me.

Take a photo in WPF using the default camera app in Windows 8

I was asked to develop a software in vb.net and one of it's features should be the possibility to take photos on a tablet PC. I already played around with the MediaCapture API which returns me a photo, but as it seems that it's not possible to show a preview or anything else outside of ModernUI apps. It's just pure photo capturing.
I thought for a little while how this problem could be solved. I got some inspiration from my Android phone then. My idea was to call some sort of API to open up the regular Windows 8 camera app in ModernUI mode, let the user take the photo and then receiving that through a "return value", just like you usually do it in Android apps.
Now my question is, if there is a way to start up the Windows 8 default camera app, let it take a photo and receive that back into my WPF desktop application.
I could develop my software as ModernUI app as well, but I never did that and it also seems like you must publish it over the web store then, but I only want to use that inside my company.
My other (simple stupid) idea would be to ask the user to open the camera app by himself, take some photos and come back to my software later. I could then receive the images from the folder they were stored in. I guess that would work as well, but I don't really like that idea because it's not very intuitive and seems just stupid.
If you have an idea (or an alternative), I would be really happy if you could share it with me.
Thanks in advance!
Unfortunately, there are no .NET classes that allow you to access a webcam or integrated camera on your computer. This means that you have to take a look at the native Windows API and call it from your application. I cannot point you to the right methods that you have to use, as I just have used Microsoft Media Foundation to capture a continuous stream of images from a webcam and encode it to a video file.
There are some sites that encapsulate this native functionality in .NET classes, but I don't know if they are good or not:
http://dotnet.dzone.com/articles/using-webcam-wpf-application
http://www.yiigo.com/guides/vbnet/how-to-process-image.shtml
(just google for more if you'd like to).
In Windows Store Apps, this task can be performed relatively easy with the media capture API you've mentioned. You can also side-load Windows Store Apps if you have Windows 8 Pro or Enterprise - then you do not have to publish your app in the Windows Store.
If you have any further questions, please feel free to ask.

Winform application for tablet?

I have a customer who wants an application for his travels where he can update an online DB, he doesn't want to buy a laptop, he wants a tablet or something similar. I have no knowledge nor desire in creating special apps for mobile devices, I want to create a winform just like I always did when it was targeted for pc. Tablet pcs (which from what I understood is just a regular pc?) are still very expensive in my country.
Is there a simple adjustment to make winform app run on a tablet with android or I have to build a special app for it? Any other solution? (I began in writing a web page for it, but it's much easier using winforms)
Native WinForms applications will not run directly on Android (or any non-Windows platform). You may want to begin by looking into MonoDroid for porting .NET code Android (and Mono in general for porting .NET code to non-Windows platforms).
A successful port across platforms will require that the application be structured in a very de-coupled manner. Core business logic in the abstract part of the application should be easily ported, but concrete implementations (specifically views and data/service access) will require some re-implementation for the different concrete platforms. So the overall architecture needs to be very de-coupled and pluggable.
Is a Windows tablet an option? Using various new technologies at Microsoft (Windows 8, Metro UI, etc.) you could build an application that would target multiple Microsoft-based platforms. This could easily satisfy the requirement of being "a tablet" (if the requirement isn't more specifically "an Android tablet"). However, it won't be the old WinForms style of applications.
In general you'll find that the industry has been steadily moving away from WinForms for, well, this exact reason. It doesn't port to other platforms, and there's a wide variety of platforms in demand today.
Forget convertion i was in a similar position years ago and i did something easier faster and i think smarter.
just make a winform with nice big controls take care of docking scaling anchors etc so that it will look nice and can be used with small smart devices.
Make sure you pass some start program parameters in your app and when a special parameter is passed instead of opening the main typically desktop form of your app open that new one in fullscreen.
Now the tricky parts isnelsewhere. I hade setup a tiny windows 2008 r2 server that allows remote apps to be run on it.
Create a user account that you will allow access to that server and only that app of yours with the specific parameter we talked about. (Ex myapp.exe -remote)
The what ever device he will get you can download the free app like 2x rdp or microsoft rdp in android. Make a new connection to your server (you can use any free ddns you like if you dont have a static ip) and connect with that windows server account you did before.
This account if has been properly setuped will only run your app and will only show that new mini winform you did..
The end user will do a simle click and from his internet connection will do a simple remote desktop that is linited to your app only. (Router configuration is needed once)
That way you will keep maintain just one source code and he will have low bandwidth cost and can continue his work without data loose in case of disconnection.
I use that for years in mobiles tablets and pos systems. Its fast its stable its secure its easy to maintain (nothing on the client side) and you don't waste months of learning wpf or doing xamarin converting.

Is it possible to make a silverlight program as a mac OSX app?

I have a silverlight application, now I want make it run as a mac OSX app, perhaps aiming to sell on app store. Since I'm completely a newbie in mac developing, is it possible to make this silverlight app run like a native app?
Maybe there is some way to make a browser shell, and embed that silverlight on a html to show it. is there any way make it more native without a browser control, and I want to disable the right click "silverlight" popup.
More over, since silverlight cannot access local file system directly, any good idea to do this? First came into my mind is put a webservice module in the app, so that this app acts both client(silverlight) and server, and then process the local file on server module.
The most you can do is have it run as a Silverlight Out Of Browser application (see a bit more detailed explanation here). This mode is pretty much like running in a chromeless browser, however it is still running in the same sandbox and you have very limited resource access.
Apps running this way will definitely not have the native OS/X app feel, neither will they be started similarly and you won't be able to sell it on the Apple App Store.
If you want to target Mac desktops and deliver a native experience I'm afraid currently Objective C or a framework on top of that is the only viable choice.

Silverlight and Full Trust Issue

We are planning to build a new integration component that can provide us access to user's machine installed apps from our web site.
The first word that came to me was ActiveX, but our expertise with the technology was not the best in the past.
Thinkink a lit bit more, the work Silverlight also came to my head, but the full trust thing was one of the few things I remembered reading about the technology..
The question is: is there a way that Silverlight (2, 3, 4, whatever) can run as a full trusted application from within the browser?
Links are appreciated.
Filipe
Unfortunately, no. Full trust is a feature of Silverlight 4, currently in beta, and is restricted to out-of-browser applications.
Additionally, full trust SL4 applications do not have unrestricted access to the system (particularly file system), though this may change before before release (if I have anything to do with it).
Edit: If you are considering ActiveX (which is Windows/IE only), you might want to have a look at WPF, since it can run full trust from the browser (if it's in a trusted zone).
No, like Richard said, this is not at all possible inside the browser, even in SL4. There is a sandbox, and you live in it. You can talk to web services, other Silverlight applications or the browser.
By talking to the browser, I mean you can talk to the DOM and the Javascript engine. We needed to launch a Windows application and communicate to it via Silverlight. We accomplished this by putting a small ActiveX control in the web page. It is responsible for launching the WinForms application and handling inter-process communication to it.
This method has many drawbacks: It can only work in IE, and it only works in Windows. You might also run into permissions issues. The ActiveX component needs to be installed along with the desktop application, or as an additional download. The deployment story there is pretty awful, if you ask me.
In our case, the analysts were willing to deal with the restrictions for the re-usability of an existing application, and we consider it to be an optional feature.
Does it have to be a web application? sounds like you want a desktop app. It can be easiliy distributed with one Click deployment. Will work on windows only but since you were considering ActiveX sounds like that's what you need.
Well - if you're hosting the silverlight control from an ASP.NET application - Believe you have access to
Request.ServerVariables["AUTH_USER"];
...and you can pass that on to your control as a parameter.
D

Resources