Android Question Tutorial for devs coming from Microsoft Access?

superb

New Member
I have a simple application in MS Access that I'd like to create for Android. I've never programmed for Android before, and I was wondering if there were any guides to help those familiar with MS Access to conceptually make the leap over to B4A to understand how to get similar concepts from MS Access and recreate them in B4A?
 

Mashiane

Expert
Licensed User
Longtime User
Hi

I see you only joined yesterday. I would recommend that you...

1. Watch the videos on Erels learning channel
2. Read the manuals developed by Klaus

Both of these are on the Learn menu item in the navigation bar.

To access MS Access files, see here

I wish you all the best.
 
Upvote 0

Jeffrey Cameron

Well-Known Member
Licensed User
Longtime User
I have a simple application in MS Access that I'd like to create for Android. I've never programmed for Android before, and I was wondering if there were any guides to help those familiar with MS Access to conceptually make the leap over to B4A to understand how to get similar concepts from MS Access and recreate them in B4A?
You seem to be mixing apples and oranges in your question. What language were you using to work with the MS Access database, or were you actually using the Microsoft Access application?

MS Access is database storage, B4X is a programming platform. The simplest transition from a MS Access database would probably be to a SQLite database in B4X.
 
Upvote 0

Magma

Expert
Licensed User
Longtime User
@superb First of all, welcome...

Hope you find everything you need...

There are thousands of examples using ms access databases and other db ofcourse... SQLite are much simple to use, and is the standard / natural database of Android too.. without the need of extra libs.

From the other hand MS ACCESS is a DataBase Designer Tool, with the feature of creating fast Forms, like small apps... easy... because was the Tool for only this job.

B4X is a programming language and can create much more than a database... but there is some road to walk for this and also need to read little - try some tutorials and examples... if you ever programmed at least in Basic (vb, .net, etc) will be very easy to understand and make your apps fast.
 
Last edited:
Upvote 0

aeric

Expert
Licensed User
Longtime User
Microsoft Access has built in form designer where B4A also has a Layout Designer where you can add control (we call it view) and drag and drop on your form (we call it activity layout). In B4A, we connect the database using code instead of adodc control. Just go through the tutorial to get started. You can download the Booklet in PDF and try to run the sample source codes in your Android smartphone using B4A-bridge.
 
Upvote 0

Albert Kallal

Active Member
Licensed User
As others noted, you do want to grab that cup of coffee, and go though some of the tutorials.

I am a long time Access/VBA developer. And I was looking for something to re-create an access application I had.

I found that jumping into the B4A language - similar to VB, and VBA was quite easy.

However, there are several areas that are and were a challenge:

Loading up controls on a form. In Access, we have what are called data bound controls. In a nutshell, this means we can say load a record, and the controls on the page are filled out.

With B4A, you have to write code to load up those controls.
(but, I actually don’t do that anymore).

It was a pain to write what quite much amounts to the same code over and over.
So I wrote a set of form binder routines.
This allows me to load a form, pull data into that form.
And I wrote a reverse routine.
Pull data from form, save to database.

So, now I don’t have to re-write over and over code to do the basic “same” operations I had in Access land.

I can quite much freely desing a form, and then I don't have to load up the controls by writing code
(I used the "tag" setting of each control to define the database column for binding).

Which database?

I do recommend to adopt and use sqlite. This takes some time to learn, but I do NOT recommend try to use an access database on the Android side. I suppose one can go down that road but Android land is in fact SqlLite land. (much better support for the database).

However, on desktop? What is a great tool to move data in and out of sqlLite?

Why of course Ms-access! – it is a great tool for doing this. To manage the sqlIte database (on your desktop), I do suggest DB browser for sqlIte. But, do get the ODBC drivers working from Access. Thus Access becomes a fantastic “staging” area for that data you plan to send to the phone. I even used Access to CREATE my sqlLite tables for me!!!

Ultimately, the issue comes down to “what” is the goal for the data on Android?
What is to be done with that data eventually? (send to your desktop app maybe???).


So, back to that data issue!
How are you going to move data to (and from) the Android say to your desktop computer - and even presumably MS-Access?

Well, it depends on your goal here.

If you going to have 10 users, and they all need to work with some data? Then that tends to mean some web based service and system. However, that is a HUGE elephant in the room! In other words, I want to have some data on my phone, but how you going to move data in and out? Since just data on your phone, and some B4A "forms" don't get you very far, does it?

So, if this is just quite much “for you” and some applcation? Ok, but you still have to address this data “in and out” of the phone issue.


My solution?
Well, it only me using the phone app.
So,
I moved the Access database to SQL server. A breeze for me. So, on my desktop, I run my VERY old Access program, but the back end data (database part) for Access uses SQL server on that computer. This worked for me, since I am very at home with SQL server.

And then in B4A/Android side I wrote a sync routine to sql server.

So, now anytime I am at home - phone and my computer running Access are on the same wi-fi network?

I just tap a button on the Android app (in B4A), and I do a sync with sql server. My days works and tasks are now synced.

I used a direct connect (jdbc drivers), and thus no web server, and in fact ZERO software had to be installed on my main home computer running Access for this sync to occur. So, that is "why" I used sql server - I did not have to setup, install software on the desktop side of things.

I dare say this setup not only worked, but worked BEYOND well. In fact, it works so well, that quite much everyday, when at home, one of the first things I do is pull out my phone - launch applcation, and tap the sync button. (it takes less then 1 second to sync the data). And I jump for joy every time I see that progress bar zipping along oh so fast!!! So much so, I often can't wait to get home and use that feature!!!

So, IMHO?
Your REAL challenge is how you going to move data in, and out of that applcation. This aspect cannot be overlooked.

If this is to be some type of “in the field” applcation, or have many users, then this REALLY suggests that you now have to adopt some web based system for the data pulling to the B4A applcation. Unfortantly, this aspect has so many moving parts, and is FAR BEYOND the typical Access developer skill sets.

Too much work = failed project – it just does!!!

While I am 100% comfortable building and writing web based software? I just think that setting up some simple data moving in and out of the phone was WAY too much work (too high of a cost).

As for some video, or getting started for Access developers and B4A? Oh, my, yes I would love to write up a article or do a video. – Time is not on my side! (Too busy).

This post is already too long.

However, a big picture, or so called 50,000 foot view point is required in regards to the data in and out issue.

But, B4A is without question the best choice and tool for this job – especially those coming from VBA/VB6/VB.net land.

Regards,
Albert D. Kallal (Access MVP 2003-2017)
Edmonton, Alberta Canada
 
Upvote 0

Tony Daly

Member
Licensed User
Longtime User
One bit of advice I would give is to use B4J to develop the sqlite part of the application. It is much faster to test than B4A and you can re-use the core code in B4A.
 
Upvote 0

MrKim

Well-Known Member
Licensed User
Longtime User
You seem to be mixing apples and oranges in your question. What language were you using to work with the MS Access database, or were you actually using the Microsoft Access application?

MS Access is database storage, B4X is a programming platform. The simplest transition from a MS Access database would probably be to a SQLite database in B4X.
MS Access is BOTH! It is an excellent rapid development tool. You can build everything in one file, then split out the data and move it to the server (good for about 5 users max) and then there are excellent tools that will convert the back end to SQL Server (takes about 5 minutes) and you can then connect the front end to SQL.
 
Upvote 0

MrKim

Well-Known Member
Licensed User
Longtime User
I have a simple application in MS Access that I'd like to create for Android. I've never programmed for Android before, and I was wondering if there were any guides to help those familiar with MS Access to conceptually make the leap over to B4A to understand how to get similar concepts from MS Access and recreate them in B4A?
Do you need an external database or is it a stand alone app? MS Access is where I came from. I will help when I can.
DO use B4X Pages. It greatly simplifies the development.
I highly recommend installing B4J and learn on that. It is free and I find it much easier to work with and it is not a pig of an install like Access. And you can use tools to build and inspect your tables.
The simple tools for writing queries and building tables are just not available internally. Install SQLiteStudio on Windows and use that to build your databases/tables. Write your App In B4J, then move it to Android.
I still use the Access Query builder to start my queries, it is just so easy to use. Then paste them into my code.
SQLLITE is the default internal DB. If you are doing a small DB internal to your app use it. But it is DIFFERENT. Basically there is NO type checking. Data types are just recommendations. You can create a numeric type but if the data you pass is NOT numeric it will store it anyway.
If you are a learn by doing not by reading type like me then
Have a look at this: https://www.b4x.com/guides/B4XSQLiteDatabase/?page=1
and https://www.b4x.com/android/forum/threads/sqlitelight-four-simple-sqlite-projects.35419/
There are no bound fields. You will be writing a lot of assignment statements you never needed in Access.
The good news: You have a LOT more control over what you do.
The bad news: You are going to write a LOT more code than you needed in Access.
I have attached an example of a simple B4X SQLite app. In Access this could probably be done with No Code.
It should run as is in B4J, just unzip it to a folder. I will leave it to you to get it running in B4A.
Happy learning!
 

Attachments

  • SQLLiteExample.zip
    257.6 KB · Views: 56
Upvote 0

Jeffrey Cameron

Well-Known Member
Licensed User
Longtime User
MS Access is BOTH! It is an excellent rapid development tool. You can build everything in one file, then split out the data and move it to the server (good for about 5 users max) and then there are excellent tools that will convert the back end to SQL Server (takes about 5 minutes) and you can then connect the front end to SQL.
Not to split hairs, but MS Access uses Visual Basic for Applications for the RAD aspect, which is a sub-set of VB5/6. If someone asks me how to come from Access to B4X, I'm going to give SQLite advice, if they ask me about coming from VB6/A then I'll have a quite different response ;)
 
Upvote 0

MrKim

Well-Known Member
Licensed User
Longtime User
Not to split hairs, but MS Access uses Visual Basic for Applications for the RAD aspect, which is a sub-set of VB5/6. If someone asks me how to come from Access to B4X, I'm going to give SQLite advice, if they ask me about coming from VB6/A then I'll have a quite different response ;)
True, The original question is was pretty clear he has been working only with Access/VBA. I would think if he was working in any other language he would mention it.
 
Upvote 0

Jeffrey Cameron

Well-Known Member
Licensed User
Longtime User
True, The original question is was pretty clear he has been working only with Access/VBA. I would think if he was working in any other language he would mention it.
I may have misread it, but I didn't see any mention of VBA. I've written "apps" in MS Access in the past that were purely saved SQL queries and didn't need any VBA UI to be used. My confusion may stem from that ;)
 
Upvote 0
Top