I've managed (over a very long time) to write a program in VB using Visual Studio 2008. This program is now published to my website and works well.
Probably because people shy away from downloading and running .exe files or due to lack of my understanding of search engines, I don't appear to have had much interest.
I have now decided to convert it to an Android and then, if I can manage to master Android, possibly to iOS.
Having made a start within Android Studio I am finding it very difficult and wondered if I'm missing anything.
I have a .sdf database in the original program which has fixed data and rarely needs modifcation and the data contained within it was taken from an earlier MS Access database.
I have the following two questions, which may need to eventually be independant threads, these are:

    • Can I use .sdf database within Android app? (I've looked at SQLite within Android but can't see how to transfer data).
    • Is there anything I should be aware of to help make eventual conversion to iOS any more straightforward?

Dani AI

Generated

Short, practical plan for that ties the thread together.

You cannot run a SQL Server Compact (.sdf) file natively on Android. The usual and reliable path is to convert the .sdf to a SQLite database file and ship that with the app. A widely used tool for this is the SqlCeToolbox (Visual Studio/SSMS extension or standalone) which can export a .sdf to a SQLite file or SQL scripts; use it first to produce a validated .db you can test on desktop SQLite tools. (github.com)

Once you have a .sqlite/.db file, the simplest Android flow for rarely-changing, read-mostly data is to bundle it in the APK and copy it into the app database folder on first run. Modern Android apps can use Room’s prepackaged-database API (createFromAsset) to copy and validate a shipped DB, or you can use the older community library SQLiteAssetHelper if you prefer its upgrade-script convention. Room handles schema validation and migrations; SQLiteAssetHelper gives a simple copy-and-upgrade pattern. (developer.android.com)

About strategy and iOS: and were right to raise the web-app option — a responsive site or a Progressive Web App (PWA) gets instant reach and avoids app-store friction. If you want native apps and to reuse .NET code, consider moving core logic into a portable .NET library and using a cross-platform approach (for .NET shops, .NET MAUI is the modern path). Remember iOS has extra requirements (building/signing needs macOS/Xcode and an Apple Developer account to publish), so plan tooling and signing workflow early. (developer.mozilla.org)

Quick practical checklist

  1. Use SqlCeToolbox to export to SQLite and sanity-check schema. (github.com)
  2. Put the .db in assets/databases and load with Room.createFromAsset or SQLiteAssetHelper. (developer.android.com)
  3. If you plan iOS later, separate UI from business logic now (portable library or web API) so the heavy logic isn’t tied to Windows Forms.

Recommended Answers

All 3 Replies

Do you want to run this as a native mobile application, or as a web application? If native, then iOS and Android use very different programming languages. If web, then use standard web application tools such as html + css, javascript, jsp, php, etc. which will run on just about any web browser, including mobile ones. You can use standard web services to interrogate the device (mobile or desktop) type, browser, and such in order to scale the output to the capabilities of the device.

As I'm not sure of how to make current web download work on mobile devices, I assumed the only option was to create an app for mobiles (starting with Android). My program is probably not very professional from a programming point of view but appears to work well and the programming gets quite complicated making it difficult to convert. Is it something that, if I provided website address, I could get looked at and then given advice on best way to proceed or is this outside of scope of this forum?

Centorpe, you current have Windows Form like app.exe, built with VB.NET right? That app.exe can only run at windows with .NET Framework installed. It would probably run at Windows Mobile, but I'm not sure about the new Windows Phone, I think only WPF(Windows Presentation Foundation) apps run there.

Anyway, if you want to make your app accessible for most people you have basically 3 options:

  1. Program a version for each plataform (Windows, Mac, Android, IOS, Linux and etc)
  2. Use meta developomet softwares that genereate codes or executable for various plataforms (I never liked this option, there're lots of plataforms like that but I never used one that worked well for complex apps).
  3. Build an Web App that run in any modern browser.

Option 3 for me it's the best. You create only one app that'll run in allmost any modern browser.

The point is, a web app it's very different from a Windows Form or a Android app. Those two are client apps. With web, you have the server and the client.
So, you could use part of your VB.NET code to create the server side of your web app. But you'll have to create a new interface with HTML, CSS and JavaScript.

You also must bear in mind that in a browser you won't have the same access to the client's machine that you would have with native apps.

If it seems a good option for you, just google VB.NET Web application to get started with it.

Good luck.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.