How to access localhost (xampp, phpmyadmin, etc.) from an Android device? - android

I want to make an application on my android device (raspberry pi), which scans an item barcode, adds it to a list, and then tallies up everything. As I have more experience with Web App Development, I figured I might be able to build the app faster this way. However, my problem is, that I am now considering how I would access the localhost database in order to pull the data linked to the corresponding barcode scanned. Should I just stick with SQLite and build an android app?
Edit: I just noticed that there's something called "PAW Server". Has anyone had any experience with using this?

Related

Android app, Is there a way to get another device to access that url without having to type it manually by the user?

best regards from Venezuela, I am new to stackoverflow, and this is my first question on this site.
This question will be long because I am providing a lot of detail, so this question is as clear as possible.
Brief introduction.
I have created an app that runs on Android devices, this app allows you to share files between devices that are connected to the same WI-FI network. but with a different methodology to that used by apps that are intended to fulfill this same purpose.
On the device where my app is running (which we will named device one), a url similar to http://192.168.1.102:7898 is generated, and said url must be entered in a web browser installed on the device with which you want to share the files (which we will named device two).
The main purpose is to offer a way to share files between devices, using WI-FI. without the need for device two, my app has to be installed.
You can find more information in https://labs.xda-developers.com/store/app/com.tecnoelias.ipfiles
...
So far everything works fine. But, it is annoying that every time someone wants to share files using my app, on device two, they have to enter the url described above. keeping in mind that said url will change as the WI-FI router decides, and therefore, you should not use shortcuts to the url (bookmarks or navigation history).
Having said all this, the following question arises.
Is there a way to get device two to access that url without having to type it manually by the user?
To accomplish this, three ideas occurred to me.
1: Generate a QR code in the app. but this requires that on device two, an additional app is installed that can read QR codes. which violates my purpose.
2: Implement in the app, a mechanism that allows you to find other devices that my app is working on, and in this way, interact with those devices (through my app, similar to how other file transfer apps do). This is a good idea, but it nevertheless requires that my app be installed on both devices.
3: My third idea and the one I would like to implement is the following:
On device one, it will open my app and then activate it.
When the app is activated, the app will search for other devices that are connected to the same WI-FI network, until it finds device two.
If successful, a SOMEWHAT will be sent programmatically to the device two, that SOMEWHAT can be, a message, a bit, a data packet, or anything else that helps to realize this idea .
After device two receives that SOMEWHAT, it will show a notification or a pop-up window, which will allow access to the url generated in my app (on device one).
Consider two things. 1: NO additional app MUST be installed on device two. and 2: Because device two can be running any operating system, the SOMEWHAT will be a different mechanism for each operating system, (operating systems can be, Android, IOS, BlackBerry, Symbian, Windows Phone, Windows, Linux, Mac, among others).
If for example, device two, runs Android 10 (not rooted), and has the most common applications installed, which can be: WhatsApp, Facebook Messeinger, Google Play Services, other Google apps, and system applications.
My thought is that you should be able to use one of those apps, to receive the url, and after clicking on that url, the web browser will open, and then it will load the corresponding webpage (which in this case, is to access the files shared by device one, through my app).
Any ideas?
You can give me your opinion, some code, or you can just tell me that this can't be accomplished.
Any response or suggestion are appreciated.

local storage being wiped in ionic on iOS and android

I am making a mobile app w/ a rails server for the backend. The basic premise is when a user signs in successfully, the server returns a unique token and their user_id. I store only those 2 things in local storage (window.localStorage not any library)
localStorage.setItem('user_id', data['id']);
localStorage.setItem('authToken', data['auth_token']);
I then use the token/ID to communicate with the server.
The problem, is recently in testing (app is already live w/ a couple dozen users), the token is occasionally not getting set or saving, and as a result, I get a 500 error. I say occasionally because sometimes it does work. I guess I'm mainly just confused. It was working fine w/ my initial pushes on the app, and works on ionic view. I don't know what has changed, as I have not changed any code.
From my standpoint and in my initial debugging, it looks like local storage is either unreliable, i need to use an angular/ionic option (not window.localStorage), find another way to store data like I have been (SQLite?), or it could be a permissions bug?
If anyone has experience something similar to this and found a viable solution, I would love to learn more about this and find a solution to fix it.
I think that before you choose another data store option, you must see your application in execution, try inspect the app in Google Chrome inspect or in Safari (case iOS), look at the localStorage proprieties using your app, I believe this is enough for you do fix your bug.
Inspect Chrome: https://developers.google.com/web/tools/chrome-devtools/remote-debugging/
Inspect Safari:
http://phonegap-tips.com/articles/debugging-ios-phonegap-apps-with-safaris-web-inspector.html

What is the proper structure for accessing a database on mobile apps?

I'm a complete beginner with mobile development. A friend of mine approached me with a project idea, asking me if it was possible to do it. The way I see it, it is a mobile app that needs to read and write data on a database in order to write inspection reports on the job of various staff members.
I told that friend that I would check how mobile development works first and would try to create a prototype to present. I've asked and Android is the main platform that is desired, so I've tried working with Android Studio and it is pretty straight forward up to now.
So, now I'm wondering what is the proper way to sync mobile apps with the database. Last time I worked with a database in a project we had multiple clients connecting to a server to play some small game together and the server would access the database and send the data back to the client through the network connection. So, I was wondering if a mobile app was supposed to use this communication structure or would simply talk directly to the database instead of a server.
The structure I have in mind:
Is this an acceptable structure? Or am I thinking of this the wrong way?

Connecting iOS, Android, and Rails App to One Database

My friends and I are developing a rails app (ruby), iOS app (swift), and android app (java). We are trying to figure out the best way to connect them all.
From our current research, we are under the impression that an API will need to be created with rails and the mobile apps will then have to communicate with that. Is this the only solution? I am also understand that apps can "pull" data from an api, but what about the other way around? We would like each application to be congruent with each other... for example, a record is created in the iOS app. As soon as this happens, the record should also be able to found on the rails app.
When thinking about it, it seems like all we would need is one database, and then have all of the apps connected to it. Would something like this work?
Having trouble finding solid information regarding this. If you know of any documentation, please pass it my way.
The best way is to host database in cloud and access to that common database from all applications. If you host your database with any hosting provider, they will give you a connection string using which you can access from any application. See Amazon AWS for example.
As I understand it, the popular way to interface with your database would be to expose it through a REST framework. Doing this, it doesn't matter how many apps you want to be able to interact with the data, or what platform they are on.
Also, check out Kivy as an option for your mobile implementation, as it allows you to deploy to iOS and Android from a single code base. Of course, you may need to account for differences in hardware APIs, etc... But that would be easier, IMO, than maintaining multiple code bases.

Android shared database development

Please give me some light regarding to this situation. I'm new in android development and I don't know how to handle this. I need to have my application to be install in many Android devices at least two device. Now I want both of them to share single database at the same time because there will be data to be process by one another. I'm a full pledge ASP.Net programmer so my mindset regarding this situation is to build a host device then the other one will connect to the same network as where the host is connected or is there any other way how this two can be connected then share the same database.
Thanks in Advance.
Make a REST api and talk to it with all android devices. The server must control the database to make sure that nobody reads or writes the same database rows at the same time.

Categories

Resources