Create Realm database on Windows - c#

Basically:
I have some data in Excel file (it's best way for my project).
I need to process it and write into Realms database.
Then place this filled database into android project as resource.
So i created simple console c# project to generate database. But then realized that i can't use Realms on Windows.
What is the most comfort way to do it if i work in Visual Studio 2015 with Xamarin under Windows 7?
I think I can just send Excel file to my Android phone (or use emulator) and perform data processing and database building in Android application but... this just sounds wrong.

We have an internal build working on Windows but not yet ready for release.
So, yes, whilst it feels ugly, your Android emulator approach is the best idea right now.

Related

How can I convert my existing C# Windows Desktop Form project in the easiest way to a Windows service. (The form UI part I want to scrap completely)

I am a beginner and have programmed a C# Windows Desktop form app with Visual Studio 2022. The app is collecting data from remote machines in scheduled plan (automaticaly every 2 hours, without needing a manuel trigger)
The user interface was more for
making some adjustments and fine tunings and
showing diagnostic screens like charts for the developing phase of the new concept.
Actually the concept is fine and there is no need for the User interface parts of the project.
Now I want to convert my project to a windows service. As I am doing this for the first time I don't know how should I do this in the easiest way.
Should I create a new Windows Service Project and design the project from beginning or is there an easier way to make the conversion?
If you want to run a desktop application regularly, you should try Task Scheduler which is provided by Microsoft in windows management tools.
Windows service usually run a console/web application which need long time running. Desktop application does not fit that.
Converting an application to a windows service, you can try this project: https://github.com/winsw/winsw I use this tool parse my console/web application to windows service. maybe you can try and see if it works.

Convert C# Windows forms code to C# Android code

I recently made a program in Windows Forms using Visual Studio but my friends asked me to make an app for it. I then noticed that Visual Studio has made it possible to make apps directly in C#. But when I opened a new project it was different from what I'm used to (obviously).
What I'm looking for is an easy way to convert my old windows forms code into the Android format but since I'm generally new to programming I don't know how myself. Do any of you have any tips or good tutorials that can help me? I have been googling around but didn't find anything that helped me.
You can't automatically. With Xamarin you can write your app in c# but you must rewrite a lot code, specially ui interface. Maybe you can reuse some functions and logic
I honestly don't think it is possible.
Windows forms is Windows Forms and Android is Android, these are two separate things that could be joined using Mono (Xamarin) for example.
The code will not transform on it's own, and magically follow Android logic. To create Android apps, you must learn Android.

Including C# ConsoleApplication in UWA

Does anybody of you guys have experiences with including a C#-based Console Application in a C#-based Universal Windows App?
The reason why I'm asking: I've an already exsisting Console Application developed by another developer. This Application includes a database with all the queries which I need for my App.
The problem: When I try to include the CA in my UWA project many commands like
private global::System.Runtime.InteropServices.HandleRef
throw new global::System.ApplicationException
don't get identified by VS2015.
Is there a way to let the UWA project identify CA commands? For example with adding an external CA-library or something like that.
Thank you!
You can't combine full .NET (console, winforms, WPF) assemblies with an UWP app, as they're different .NET frameworks. For more details, please read this reply. Part of the code is shareable in a Portable Class Library (PCL), but most likely not all of the code you've written.
Possible solutions:
Create an API (yourself or with the other developer) to expose the functionality needed over a (preferably) REST api.
Find a way to cheat the system. Example: launch a file (associated to the console application) with the Launcher api and output the results to a text file on disk, which you then read from your UWP app.
The first one is guaranteed to work. You might find a way to cheat the system for the second 'solution', but there's no guarantee that it won't break in the future when Windows 10 gets updated (experienced that myself for another 'hack' on the upgrade between Windows 8 and 8.1).

Can I run multiple instances of 'the same' Windows Store Application at once?

Is it possible to run at the same time a couple Windows Store Applications?
I have written a chat application (in C#), and want to test it on one PC, but I can't make it work.
Is there any option to do this? Or any ideas how to get around it?
No, Windows Store apps are strictly single instanced, see this post:
http://social.msdn.microsoft.com/Forums/en-US/windowsdeveloperpreviewgeneral/thread/daf6f12f-b54d-4550-a70d-d92e6e06bfdc
Howerer there might be a solution, if you are owner of that app and you have access to source code and project, just build and deploy the app, change the app Name and ID in manifest file and deploy it again - it should be then shown as another app in Start screen. Note I have not tested this, but it worked fine for Windows Phone apps, so I guess it should work on Windows 8 as well?

Learning to work with databases - from web to desktop application

I have experience with MySQL as a web developer. I also have some experience with desktop applications, but I have never needed a database in one. Now I want to create a simple desktop application for me, which I would like to make in Visual Studio C#. I know I can work with database in C#, but I have some noob questions, which are not answered by tutorials I've browsed through so far.
There are obviously more solutions, what would you recommend for simple application aimed to work with vocabulary for new languages learning?
What does a database mean for application installation? Can I keep it simple, so that I could than run the application on other computer without installing something more for the database to work?
I would appreciate some tutorials, or advice on start.
If it's a simple application you could go with Microsoft SQL CE database - CE means Compact Edition. You can then install the app in whatever computer and just place the accompanying database file in a directory of your choice and should be good to go. There's no database server involved and as a result it's pretty light when deploying the app.
It's a bit hard to find a question, but I think I found one - you're asking how to install a database with an application.
If every user of your application sees her own copy of the data, with no sharing, then MySQL is probably an overkill. You should take a look at SQLite instead. There's no installation at all.

Categories