OK, it seems there's several things going on here. >From your URL, it looks like you can download a >>copy of<< a sqllite database file.
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 the database file. It cannot do these things over an HTTP connection -- and shouldn't try to do it over any other kind of network connection, either. 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. But that's not really using it as a database in 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 shared database, and you DO want to expose it as a web service. Examples would be contacts databases, current sales figures, stock price tickers, etc. 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 your database, 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. 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 <[email protected]> wrote: > Thanks Bob, > I got very good information from this... > Let me explain thing i want to do.. > There is a database present at some > IPhttp://10.117.23.45/databases/database.db > I want to access this database from my android application.. for this > im using HttpURLConnection interface.. > > The way that im accessing the database is 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 <[email protected]> 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 <[email protected]> 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 - -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

