Sharing a file from an android device to PC - java

I have an app that creates a file based on data entered by the user and writes it to a file, however I need that file to then be transferred to a computer via Bluetooth (the laptops I am using don't have Wi-Fi direct and internet connection cant be relied on) and I cannot figure out how to do it. I have followed the tutorials on the android developers site but I cannot seem to get it to work. Any ideas or code samples that I can try?
I have tried following the android developer tutorials for Bluetooth and sharing and neither of them addressed sending files to a non-android device, they only addressed sending data (in a non-file form) to android devices and sending data to other apps.

Related

Mobile Sound Tracker Application Architecture

I have an assignment, but I can't seem to get my head around it. I've been tasked to create a mobile app on Android Studio using the microphone sensor to record audio (Parameters: Duration & frequency). The data/sample is then stored locally, perhaps using SQLite to store the id, date, time, location and sample. Let's say after 10 samples (this is where it starts to get confusing for me), the samples are bundled up and sent to the communication server which I believe OkHttp client is used in this case. The data gets sent to a local server (Apache?) and a website (Springboot) is used to retrieve the information and show the samples on Google Maps.
https://imgur.com/a/3cXzCQl
Link to application architecture is above. I have no doubt it is wrong, but would love some insight on it please. Also, I very new to all of this so I'm sure there are a lot of gaps in my message above. If you have any questions please feel free to ask!
Technologies I've been recommended to use:
Local Server: Apache
Website: SpringBoot
Communication tool: OkHttp
Android application: Android Studio

How to access directly internet on WearOS app

I am looking for My data on wear OS app to send to my external apache server with php and mysql.
Ultimately I need watch sensor data in MySQL database, So i created a POST request page using php. How do I send POST request?
Note: I am not using mobile phone between WearOS app and My server. WearOS is connected to internet via WiFI
Please if you know any solution help me
FYI: I tried basic things given at https://developer.android.com/training/wearables
Using Smart Watch with API level 23
Regards
Unfortunately your watch system version is too old. I strongly recommend you to buy a new watch or try update to Wear OS 2.x (API25) if your device is still under maintain.
If you insist on using current device the only way to access the Internet is via mobile phone. You can not send HTTP requests directly.
But the old version system should not be able to connect the WiFi. Please confirm your version at first. If your API level equal or larger than 25, you can access the Internet as same as phone using OkHttp or others you like.

Host database using Android phone

Here is the current scenario:
I have two(2) Android phones.
Android Phone 1 as the server phone.
Android Phone 2 as the client phone.
Here is what I want to do:
I want to create an Android-based app (E.g. Student Information app) where it will have basically two (2) modes:
Server - for adding, editing and deleting data on a local database.
Client - for viewing data from the database of the server.
The app will be installed to Android Phone 1 and set to Server mode.
The app will be installed to Android Phone 2 and set to Client mode.
I want to ask these questions:
I want to locally host the database of the Server app, so that Client app will be able to view the data. Is this possible?
If yes, how can I do it?
Note:
I am currently a web developer so I know that connected on the same network is a requirement.
I have implemented the same concept on a medium business where the web-based system is locally hosted so that computers on the same network can access it.
Suggest everything that you want to suggest, except the disadvantage of doing this concept. I am aware of some obvious disadvantages based from my research and willing to face the disadvantages provided that I will be able to implement the concept.
Rooting the phones is an option.
I want to accommodate small-sized business that is why I want to use Android phones rather than using Desktop Computers/Laptop.
I have read similar suggested questions here based on my title.
We have done the exact same thing in my company. The way we solved this is that the server exposes a service using the Android NSD API, so the clients (using the same API) can find it on the network. And after a client has connected to the server, the server sends its database file (yes, the .db file in /data/data/...) to the client via OutputStream. When the client receives the entire database and checks for its integrity, it copies it to its own /data/data/... and restarts part of the app.
Android NSD

Sending simple text data live from Android client to server

I've seen other posts on streaming live audio and video from an android application to a desktop server, but not yet for simple textual data. Basically, I'm trying to send key values from the android keyboard directly to a desktop server (which is implemented in java) as I type on the client. This would be a simple remote-keyboard sort of application that displays a keyboard on the android device and sends the live key taps to a server, which accesses the PC keyboard via the Robot class. I understand how to send text from the device to a server, but I am stuck on how to make the transfer of the text data to the server instantaneous, as the user types on the device.
I've tried to adapt from the examples for live video/audio streaming, but I couldn't figure out how they worked as I am still very new to client/server programming and programming in general.
Any help would be appreciated. Thank you.

Implementing native android code with AIR code

After following these instructions to integrate Adobe AIR with native Android I have a few issues.
I have managed to get a bluetooth connection going in native android, setting up 2 BluetoothSockets which then shows the air app also packaged within the apk. This included air app requires 2 connections to somewhere (normally wifi).
I have it connecting to TestService1 and TestService2, which is then passing the traffic between these services and the BluetoothSockets.
It is a little slow as i have to put Thread.sleep(80) in between reading from bt socket and writing to the AIR app for it to work currently.
My 2 questions are
Is there any way to get the AIR app to know about and access the Bluetooth Sockets created in the Android code rather than having the 2 Services being the middle men?
Is this kind of release (hybrid) allowed in Android Marketplace does anyone know?
Really hoping to find an answer to question 1 as currently my bluetooth server is continously sending data and using the TestService1 and 2 to get this bluetooth data to the AIR app and is causing a 10 seconds lag.
Thanks in advance
These apps are definitely allowed in the Android market.
You should be able to send Bluetooth data immediately over the socket to the AIR app. It doesn't seem like you should need 2 separate services or a sleep. I think your service that is talking to the Bluetooth can also listen on a socket and send data over that socket when it gets it.

Categories