@Traun, You're right on your responses - its me who confused because at first we were talking about the sync gateway, but then later I realised that the Raheel's second question was related to the mobile app side URL and not the gateway, so I made another answer to correct myself - it just confirms what you said. I think it should all be clear now.
BR, Thiago On Monday, September 29, 2014 10:26:02 PM UTC+2, Traun Leyden wrote: > > @Thiago, > > This feels like a few discussion threads are getting crossed or something > .. either that or I'm totally confused. > > My most recent post was in response to: > > but when i use this url >> public static final String SYNC_URL = "http://localhost:4984/sync_gateway >> "; >> and sync the documnet >> URL syncUrl; >> try { >> syncUrl = new URL(SYNC_URL); >> } catch (MalformedURLException e) { >> throw new RuntimeException(e); >> } >> Replication pullReplication = database. >> createPullReplication(syncUrl); >> pullReplication.setContinuous(true); > > > which was a Couchbase Lite Android app trying to do a sync with Sync > Gateway. > > In this case, use "localhost" won't work in any situation, because the two > common cases: > > * Run Android app in emulator --> Requires the use of the special 10.0.2.2 > address if Sync Gw on workstation, or public IP of machine if running in > the cloud > * Run Android app on device --> Requires the use of the LAN IP or public > IP of machine running sync gateway > > and none of this has to do with the configuration of Sync Gateway to find > out the address of Couchbase Server in order to communicate with it. > > > >> But this is well explained in the documentation !! The rest is just TCP >> networking as usual: your android device just needs to be able to reach >> your sync gateway (but you should not have something like this: >> http://localhost:4984/sync_gw in your mobile device, since the device >> doesn't need to sync with itself > the database is already there ;) >> >> > The only way you'd want localhost:4984 from an Android app is if Sync > Gateway itself was somehow running on the Android emu/device. SInce Sync > Gateway doesn't run on Android, that setting doesn't make sense. > > > >> BR, >> Thiago >> >> >> On Monday, September 29, 2014 6:23:24 PM UTC+2, Traun Leyden wrote: >>> >>> If your sync gw is running in cloud with public, use the public ip. >>> >>> If sync gw is running on wifi LAN, use LAN ip of machine running sync gw. >>> >>> On Sep 29, 2014, at 8:53 AM, Raheel Mateen <[email protected]> wrote: >>> >>> i am testing on galaxy s3 (Device) >>> >>> On Wednesday, September 24, 2014 4:57:12 PM UTC+5, Raheel Mateen wrote: >>>> >>>> I follow the following to start the couch db on android >>>> http://docs.couchbase.com/couchbase-lite/cbl-android/ >>>> cbl-android-1.0b2/#developing-apps >>>> >>>> but i actually not understand how to query in couch db for example if i >>>> make a document in a db so how should i access that document with the help >>>> of query. >>>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Couchbase Mobile" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To view this discussion on the web visit https://groups.google.com/d/ >>> msgid/mobile-couchbase/bcd8fd9a-2ba4-4817-998b- >>> 94edd4233bf9%40googlegroups.com >>> <https://groups.google.com/d/msgid/mobile-couchbase/bcd8fd9a-2ba4-4817-998b-94edd4233bf9%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "Couchbase Mobile" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/mobile-couchbase/8ea69238-3d7e-47e5-841d-ab0242c1b52e%40googlegroups.com >> >> <https://groups.google.com/d/msgid/mobile-couchbase/8ea69238-3d7e-47e5-841d-ab0242c1b52e%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/d8405119-e70f-4617-ac69-35746892e46a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
