Trouble connecting local and hosted db to android build

first question: connecting to my local mongo when testing locally on my android phone
so from what i’ve read here, the device and computer need to be on the same wifi network and i need to declare --mobile-server.
i’ve got my phone on airplane mode connected to the wifi network and plugged into my laptop for testing. i don’t believe this is a firewall issue because i have other hardware i’m connecting to this way for work.
these are the various scripts i’ve tried but none work. i’m at a complete loss! i’m running the latest meteor and it connects fine on web of course. anything in bold i’ve also tried on an emulator.

"android-device-local": "MONGO_URL=mongodb://:@localhost:27017/dbName meteor run android-device --mobile-server 192.168.0.102" <-- ip address of my laptop on my wifi network

"android-device-local": "MONGO_URL=mongodb://:@localhost:27017/dbName meteor run android-device --mobile-server 192.168.0.102:3000"

"android-device-local": "MONGO_URL=mongodb://:@localhost:27017/dbName meteor run android-device --mobile-server locahost:3000"

“android-device-local”: “MONGO_URL=mongodb://:@localhost:27017/dbName meteor run android-device --mobile-server locahost:27017”

“android-device-local”: “MONGO_URL=mongodb://:@localhost:27017/dbName meteor run android-device --mobile-server 127.0.0.1”

“android-device-local”: “MONGO_URL=mongodb://:@localhost:27017/dbName meteor run android-device --mobile-server 127.0.0.1:27017”

“android-device-local”: “MONGO_URL=mongodb://:@localhost:27017/dbName meteor run android-device --mobile-server 127.0.0.1:3000”

“android-device-local”: “MONGO_URL=mongodb://:@localhost:27017/dbName meteor run android-device --mobile-server 192.168.0.109” <-- ip address of my phone on my wifi network

“android-device-local”: “MONGO_URL=mongodb://:@localhost:27017/dbName meteor run android-device --mobile-server 192.168.0.109:3000”

“android-device-local”: “MONGO_URL=mongodb://:@localhost:27017/dbName meteor run android-device --mobile-server localhost:12816” <-- chrome’s remote debugging url

second question: connecting to my hosted mongo (mongodb.com)
i do understand that the --mobile-server here would be an online server that hosts your app, but this is where i get confused… if it’s hosted on the play store, what does this mean exactly? i have a personal website (domain registered on google, hosted on aws amplify) that i could use for this, i tried setting an env variable of MONGO_URL with the connection string on my amplify settings but that didn’t work. i’m not sure where to find the server url either or how at all to set this part up. is there a guide that goes into detail on this part?
so i guess a more specific question is, how to setup this hosting and get my server to tell my app where/how to connect to the right MONGO_URL? is this something that can only be done with galaxy?

if you need anymore context please ask!
update: i’m on linux, ubuntu 18.04

I use Windows and i think localhost should work which i have tried on Cordova Android through local network.and works.
But you can change it into your Local Ip address :
`In package.json

{
"name": "vue-meteor-demo",
"private": true,
"scripts": {
 "dev": "set \"MONGO_URL=mongodb://192.168.0.102:27017/test\" && meteor --port 3000`

and then npm run dev

I use Mup and setup my Mongo connection with the connection string:
MONGO_URL: 'mongodb://username:password@mongodbserver.com/test?authSource=admin',

You could always use some tools like : Studio 3T and easily test it out.

it seems like you mean just connecting in general, correct? if that’s the case, my mongo url connects fine just running locally on web, it’s when running locally on my android device or emulator where it doesn’t work. i’m trying out mup right now though and will update on how that works out.

ok i’ve completed this guide https://sergelobatch.com/beginners-guide-to-deploying-a-meteor-app-to-an-aws-server-with-meteor-up/ and am able to access the app via the ec2 public ip address and the domain through my web browser and it’s pulling data from the db as expected.

now running locally i’ve tried these, still with no luck:
“MONGO_URL=<mongodb.net_connection_string> meteor run android-device --mobile-server <ec2_public_ipv4>:80”

“MONGO_URL=<mongodb.net_connection_string> meteor run android-device --mobile-server domain.com

“MONGO_URL=<mongodb.net_connection_string> meteor run android-device --mobile-server domain.com:80

Can you do set MONGO_URL=<mongodb.net_connection_string>
Or on WIndows, add a system environment variable MONGO_URL and set its value to the connection string ?

sorry for the late response, i just tried it with the environment variable method and it still isn’t working

so now i’m able to connect to my local and remote db via the emulator, but still not my device. i have no idea why i’m able to connect now as i haven’t changed anything in the project, it’s just working now for some reason…

i’m beginning to suspect part of my issue may be an android api version incompatibility. the latest cordova used by android goes up to api 28 but my phone is api 29.
when i try to run on an emulator of api 29 it fails, api 28 is finnicky and sometimes works, sometimes doesn’t, and api 27 always works.
i’ve made a copy of my project and (on that copy) updated the cordova libs in my .meteor/local and i can now see both local and remote data coming in from the emulator of my api version but not on my device still

OKAY! i’ve got remote and local working on emulator and remote working on device now after adding autoupdate. god that was SUCH a headache

EDIT:
this is actually only working on emulator, still not on my device. i thought it was but i’m wrong. when i run it with --mobile-server :80 it runs with the live view from the server, not my actual local code. so i still can’t get my meteor server to connect on my device when running in development. but at least i have my emulator so that’ll have to do.