On Mar 18, 11:49 am, Bob Kerns <r...@acm.org> wrote: > OK, it seems there's several things going on here. > > From your URL, it looks like you can download a >>copy of<< a > sqllitedatabasefile. > > If this is just static content, that you're treating as a document -- > then you don't need any of what I've been talking about so far. At > this level, you have a file. You just copy it locally, perhaps to your > SD card, and then access it using Android's built-in sqllite > interfaces. > > You CANNOT access directly over the network this way. Sqllite depends > on being able to manage concurrency, and update individual pages > within thedatabasefile. It cannot do these things over an HTTP > connection -- and shouldn't try to do it over any other kind of > network connection, either.
So SQlite can't use over networks for accessing database... I dont want to save this database file into my local folder..i want to change the contents in the file by online.. > But once you have copied it to a local file, Android's sqllite should > be able to work on it directly. If you make changes, you can save it > over the network, treating it like any other docuument. This is not a good idea to use as a document.. > But that's not really using it as adatabasein the usual sense of > live shared data. It's a good approach, however, for static data, such > as historical records. For example, baseball statistics for a specific > year. > > On the other hand, if you want to be able to access the data > simultaneously from multiple applications, and at least one process > somewhere is making changes, then you DO need a shareddatabase, and > you DO want to expose it as a web service. Examples would be contacts > databases, current sales figures, stock price tickers, etc. How to expose any database as a webservice?? If u have any example code pls provide me..because im new to android as well as database concepts.. Thats y i dont have clear idea on this.. > How I'd start, is to identify each logical kind of object, and define > URL's to refer to each of them, and to each collection of them. These > can be explicit entities in yourdatabase, or they can be the results > of queries, where the query is encoded in the URL. > > Then I'd identify the data content of these, and write code to encode > each entity into this format. I'd pick either JSON or XML as a base > for my data format, just because they're readily available on most > platforms. So for communicating database(On remote server) from our application it is compulsory to write a driver like odbc??? > Then I'd define the operations on this data. > > I'm afraid I've been around this stuff to have a good beginning > reference to suggest. But I will point out that the content: URIs used > by the provider interface generally follow this pattern, so you can > look at how the contacts provider has been designed. > > In terms of the actual mechanics, an HTTP-based RESTful interface uses > regular HTTP connections and operations. The REST pattern is just an > effective way to use HTTP to build a web application. > > On Mar 17, 9:40 pm, uday kiran <uday.pic...@gmail.com> wrote: > > > > > Thanks Bob, > > I got very good information from this... > > Let me explain thing i want to do.. > > There is adatabasepresent at some > > IPhttp://10.117.23.45/databases/database.db > > I want to access thisdatabasefrom my android application.. for this > > im using HttpURLConnection interface.. > > > The way that imaccessingthedatabaseis fine r not???? > > try > > { > > URL url = new URL("http://www.uploadhub.com/mobile9/ > > gallery/gallery_android/"); > > HttpURLConnection conn = > > (HttpURLConnection)url.openConnection(); > > conn.setDoInput(true); > > conn.setDoOutput(true); > > conn.setUseCaches(false); > > conn.setRequestMethod("POST"); > > } > > The code above i have given is some sample only.. > > > As u said how to implement RESTful interface instead of doing this?? > > If u have any idea of code please let me know... > > > Thanks for the information in advance.. > > > Cheers > > Uday > > > On Mar 18, 4:26 am, Bob Kerns <r...@acm.org> wrote: > > > > Please don't do this. You really, really don't want to do this. I've > > > written about this before -- it's the wrong way for a lot of reasons > > > -- security, interoperability, performance, maintainability, > > > upgradability, compatibility with firewalls... > > > > What you want to do instead, is to build a web service, that exposes > > > the proper functionality. I'd suggest a RESTful interface (google it; > > > there are lots of examples and documents available), as it's more > > > flexible and simpler than SOAP. > > > > You don't even want to expose yourdatabaseserver to the internet. It > > > should be securely behind a firewall. > > > > And think about what happens when you want to change yourdatabase, > > > and you have all these applications out there, expecting to be able to > > > use specific SQL queries to get at the data. You cannot force users to > > > upgrade. You can just break, of course -- but you'll lose a lot of > > > customers, and a lot of them will tell other customers to stay away -- > > > and they'd be right. > > > > Actually, I just saw the message that says you're using Sqllite. So > > > you CAN'T even do it anyway, even if you wanted to. There is no > > > network access to Sqllite. > > > > I'd saw sqllite isn't a good choice for a server application in any > > > event. I'd suggest MySQL as an alternative. To quote the sqllite > > > documentation: > > > > "On the other hand, adatabaseengine that uses a server can provide > > > better protection from bugs in the client application - stray pointers > > > in a client cannot corrupt memory on the server. And because a server > > > is a single persistent process, it is able to controldatabaseaccess > > > with more precision, allowing for finer grain locking and better > > > concurrency." > > > > On Mar 17, 6:32 am, uday kiran <uday.pic...@gmail.com> wrote: > > > > > Hi folks, > > > > > Im new bie to android.. i want to accessexternaldatabasefrom my > > > > android application.. > > > > I've searched so much time in the internet but could not get exact > > > > idea how to implement?? > > > > > Please help me If any one is having idea on that and post if u have > > > > any code related to it... > > > > > Thanks for the information in advance.. > > > > > Cheers > > > > Uday- Hide quoted text - > > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en