[android-developers] Re: AsyncTask - wait until the task has finished
Hi, Could there be a case where onPostExecute() is never called because doInBackground() is stuck in some synchronous API called within ? I've a use case where am using AsyncTask like below (code for illustration only) : BackgroundCommunicatorTask mBackgroundTaskOne = new BackgroundCommunicatorTask(PERFORM_API_1); mBackgroundTask.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR); BackgroundCommunicatorTask mBackgroundTaskTwo = new BackgroundCommunicatorTask(PERFORM_API_2); mBackgroundTask.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR); Is my understanding correct that when we explicitly use SERIAL_EXECUTOR, until one thread in the queue is finished, the next thread won't be executed ? Which means if doInBackground() of the thread associated with PERFORM_API_1 is stuck for unknown reasons, then the next thread in the queue (associated with PERFORM_API_2) won't be scheduled right ? I've verified that the first thread is stuck, through if (mBackgroundTaskOne .getStatus() == AsyncTask.Status.RUNNING) { // control is reaching here. } I'm clear that for my use case I should be using SERIAL_EXECUTOR only. But sorry if my understanding of SERIAL_EXECUTOR itself is wrong.. Could you throw some light on how to handle such cases like above ? Use a timeout to kill the thread forcefully ? I tried, but cancel() on the AsyncTask is not honoring my call. -- 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
[android-developers] MediaScanner Thumbnails
Hi, (Am sorry if this question was already asked and answered... but honestly when I searched this group, majority of the answers were relevant to Android 2.1 2.2 times. I had also asked this on android platform group lately) My requirement : If I want to write an application on Android Gingerbread 2.3.4, which displays a list of all images on SD card, can I safely assume that the thumbnails for all images are generated on bootup already? Or is there any broadcast that I must be doing for this to happen ? If the thumbnail generation for all images on SD card, is still going on in the background, would there be any callback available for me to listen to, once its finished (so that I could display a 'loading' dialog in my app) ? Should I have to write my own service which is triggered on each boot, that places a thumbnail generation request for each image found on SD card ? My doubt : I wanted to understand if MediaScanner or MediaScannerService components, which run on every boot, to update Media Content Provider, generate any thumbnails for the images present on SD card (external storage). From what I could understand from the code of these respective files in frameworks/base/media... there is no call made whatsoever, to generate any thumbnails. However, when I run 'Emulator' for Android 2.3.4, for the very first time, using an SD card setup, I see that a folder 'DCIM/.thumbnails' is already generated with thumbnails present in it. (SD card setup done as prescribed in : http://blog.jayway.com/2009/04/22/working-with-sd-cards-in-the-androi...) Could anyone help me understand the sequence in which thumbnails are generated ? I was so far thinking that it is the Gallery/Gallery3D applications which generate thumbnails, when opened for very first time... Best regards Uday -- 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
[android-developers] Re: find out which activity resumed/started my activity?
Hi, Am really not sure if its possible, but just trying to think out loud.. Is my understanding correct that WindowManager component in Android platform maintains a list of all 'Windows' created thus far by different Applications' Activities (Including those of decorations like StatusManager etc.) say for example, if User goes from Home-Launcher-Calculator, and now he receives a call, a windows stack could possibly look like : CALL (on top) CALCULATOR LAUNCHER HOME STATUSBAR (bottom most... am guessing, I may be wrong) Long ago, when I worked on Maemo, Meego GNOME there used to be a DBUS Call that can be made from command line, to list down windows titles and their respective process IDs. So far in Android, there is no way we could query WindowManager to retrieve a list of titles of all such Windows... Is this statement right? If there does exist a way to this, we could possibly build a logic to check from where our Activity has come to focus right?! I may be totally wrong to imagine like this.. But am open to learning and being corrected on this :) Best regards Uday -- 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
[android-developers] Ytdandroid usage android
Hi.. Am using Ytdandroid to upload videos to youtube account . But i want to make it as private , so that it will visible to me itself. If we use gdata, gdata.setPrivate(true) simillar to this. But i dono how to do with this ytdandroid code,?? Thanks -- 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
[android-developers] Re: How to prematurely stop a long-running SQLite query?
Hi, I remember Sqlite supporting 'In-Memory' DB, which is way faster than normal DB.. Everything that we are doing temporarily, is processed in memory thus no I/O.. It could be one option to try out.. But am not sure if this is do-able on android.. http://en.wikipedia.org/wiki/In-memory_database I agree that placing an Index would help in a big way, but not too sure of its performance in situations like the one mentioned in this chain.. On Aug 23, 11:12 am, Mark Carter mjc1...@googlemail.com wrote: Has support for this been introduced recently? I have a feeling a while back I saw something in the change log (maybe 3.0?) but can't seem to find it again... -- 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
[android-developers] Re: How to change device file permission from Java app.
Hello Mark, In java.io, the File API is supposed to provide APIs like setExecutable (boolean) setWritable (boolean) setReadable (boolean) However, in the android.jar which includes all the needed classes, the java.io package doesn't provide the above APIs in the File class. Has this been done for security reasons ? Which means if an application downloads some bytes and writes to a file created through the below code File destination = new File (/sdcard/myfile.txt); there is no way to change permissions of 'myfile.txt' to 777 ? There is a 'Runtime' facility provided through java.lang, but I'm skeptical whether to use this or not. Runtime would only work on rooted devices right? eg., http://stackoverflow.com/questions/6290307/android-runtime-command-problem -- 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
[android-developers] Invoking Browser through an Intent, to perform HTTP POST
Greetings! It is clear that the Android Browser app can be launched from any other application, through an Intent as : Intent intent = new Intent(Intent.ACTION_VIEW); Uri data = Uri.parse(http://www.google.com;); intent.setData(data); startActivity(intent); This would however internally perform a HTTP GET request. I'm trying to explore to somehow launch Browser app, to perform a HTTP POST, instead of a GET request. I'm trying to load the key-value pairs in a Bundle and send across to Browser (example below) : Bundle extraHeaders = new Bundle(); extraHeaders.putString(user_name, test); extraHeaders.putString(user_pass, test); intent.putExtra(Browser.EXTRA_HEADERS, extraHeaders); But these will be loaded as 'Http headers', but not as request parameters. Moreover this attempt would still launch it as a HTTP GET request. Has anyone tried something similar ? The Browser app internally uses a WebView, which offers APIs like loadUrl () - for GET postUrl () - for POST. Interestingly, I don't find Browser app calling 'postUrl()' anywhere in its code.. Then how does it manage POST requests for websites launched through it? -- 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
[android-developers] Re: Accessing External Database
Thanks for correcting me bob.. I saw so many mails regarding this JDBC drivers in stackoverflow.. I finally decided to use RESTful webservice instead of JDBC drivers.. I've gone through one example code at http://senior.ceng.metu.edu.tr/2009/praeda/2009/01/11/a-simple-restful-client-at-android/ In this he used to get the data from a stream.. But wgen i use with database it's not working.. How do i get the table names,column/row names, a particular key from a row/column present in the database?? Dont get angry for asking again again the same question.. is it possible by writing like this?? http://WebAddresss:Port_num/DATABASE_NAME/Table_name/ if im giving like this is it going to work properly??? Is it compulsory to use XML files with REST webservice?? Waiting for ur help... Cheers Uday Kiran Pichika Bob Kerns wrote: Brion gave some good suggestions, so let me address this from a more architectural standpoint. You don't WANT to access the tables direction. A web service acts as an intermediary -- it sits between your application and the database. This allows more control over how the application can access the information. You can limit the application to change only certain fields, or apply different security models. It also allows you to CHANGE your database. For example, to split a table into two linked tables to achieve better normalization. If the application could access the database directly, the SQL queries would need to change (especially for updates). You would face an impossible situation, as you simply cannot force people to upgrade their applications. This is perhaps the biggest reason why web services are so popular, and direct database connections are almost never used in end-user applications these days. It also allows better performance -- through caching, connection pooling, and other techniques. Database servers are simply not designed for huge numbers of connections. A web service has direct connections to the database. It has as much access to the tables as it needs. It's up to the web service what that data looks like to the client application, and how much access the client has. It can certainly present a model that parallels the database schema. With a RESTful interfaice, you could have URIs that denote tables, returning a list of URIs denoting primary keys in the table, and those URIs in turn would return the content of the rows, etc. But usually it makes more sense to operate at a somewhat higher level, where the URIs in the interface denote domain entities. For example, a music service might have URIs that denote albums, composers, artists, tracks, etc. Or, more likely, it would not have 'tracks' at all, and asking for an album would return EVERYTHING about the album that the application might need, because you can do that in a single step, without repeatedly asking the server. This allows much better scaling, and much better performance and reliability in the application, than asking for the same information one piece at a time. This is yet another example of why you want a web service, rather than accessing things at the database level. On a phone in particular, there is a lot of latency. Each time you ask a question, you have to wait for the information to flow both ways, and all those delays add up. The web service has very fast connection to the database, and can do all that quickly, so you only need to ask ONE question, and get a faster answer. When designing a web service, it is entirely up to you what form the data comes back in. You can construct whatever JSON or XML objects that are convenient representations for the data the service provides or uses. Whether you use JSONObject or an XML parser is up to you. From: uday kiran uday.pic...@gmail.com Date: Mar 22, 8:15 am Subject: Accessing External Database To: Android Developers So, if we r using RESTful webservice is it possible to access the Tables present in the database??? and doing some operations on the database i.e) Adding/Deleting a row/ column into the database table?? I saw one example which uses JSON Object for getting the stream.. So if i want to access databases which class we need to use?? If u have any related code regarding this please let me know... Expecting more information regarding example code... Thanks in advance --Cheers Uday Kiran Pichika -- 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 To unsubscribe from this group, send email to android-developers+unsubscribegooglegroups.com or reply to this email with the words REMOVE ME as the subject.
[android-developers] Re: Accessing External Database
So, if we r using RESTful webservice is it possible to access the Tables present in the database??? and doing some operations on the database i.e) Adding/Deleting a row/ column into the database table?? I saw one example which uses JSON Object for getting the stream.. So if i want to access databases which class we need to use?? If u have any related code regarding this please let me know... Expecting more information regarding example code... Thanks in advance --Cheers Uday Kiran Pichika On Mar 19, 8:22 pm, Bob Kerns r...@acm.org wrote: No, you get a different set of headaches. Drivers (e.g. JDBC drivers) are not intended for this sort of application. You will have reliability problems, security problems, performance problems, problems upgrading your server once you have clients talking to it, because you can't upgrade all your clients at once, etc. You'll also have the problems getting the drivers to work on the Android platform, which lacks support for database drivers. I think it's probably possible to do, but since it's not a good thing to do, I don't know of anyone who has succeeded. I've seen a lot of messages from people who have tried and failed. Drivers are much too closely coupled to the database. A competent system administrator WILL NOT ALLOW YOU ACCESS to databases from outside their firewalls, for security reasons. You will normally would use database drivers when implementing the web server. Sqlite is an embedded server with its own API, but you could consider that a type of driver as well. But as I said earlier, a non-Sqlite database, such as MySQL, would be a far better choice for performance, scalability, and reliability reasons. Unfortunately, that means yet more stuff to learn. Fortunately, it's mostly fairly standard stuff, so you'll get to use what you learn later in your career -- but it's still something you'll need to learn up front. None of these things are that hard to learn, but it's a lot to learn all at once. Especially if you expected to do things one way, and are told you have to do them a different way. It'll be hard to switch your way of thinking. On Mar 19, 7:03 am, uday kiran uday.pic...@gmail.com wrote: Hey Bob,, Tell me one thing...instead of using Webservices,it is easy if we r using Drivers.. If we know which type of database they r using on server side,then we can access that database using related driver...so that the headache willl be reduced am i right??? what is the difference of using driver in place of Webservices On Mar 19, 1:16 am, Bob Kerns r...@acm.org wrote: On Mar 18, 2:37 am, uday kiran uday.pic...@gmail.com wrote: - So for communicatingdatabase(On remote server) from our application - it is compulsory to write a driver like odbc??? No, ODBC (or JDBC) is at the wrong level. You do not want to be doing SQL over the network. Instead, you want to create a web server that does the SQL -- and you just ask it questions (via HTTP GET) or give it commands (PUT, POST, DELETE). If you already know Java well, a Java Servlet would be the easiest way to go -- running in a servlet engine line Tomcat. Tools like Ruby on Rails are supposed to make this even easier, but will involve learning a new language. You're going to have to go and do some studying, and look at a number of examples. I'm not going to look for a pointer to an example for you, because if you do it yourself, you can chose ones that more closely relate to what you're trying to do, or better fit your style of learning. But you can start on the server side by writing a unit test that simply takes a URL, interprets the parameters, and does the corresponding SQL query, and returns the result as either XML or JSON. Once you have that, it's a simple matter to embed that in the appropriate bit of code for your web server technology (e.g. a Servlet, in the case of Java). The client side just requests the data from that URL and reads it. Once you get that far for one kind of data, and the GET operation, the next steps will be both easier and more clear to you. Part of your problem right now is you're trying to deal with the entire question at once. -- 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 To unsubscribe from this group, send email to android-developers+unsubscribegooglegroups.com or reply to this email with the words REMOVE ME as the subject.
[android-developers] Re: Accessing External Database
Hey Bob,, Tell me one thing...instead of using Webservices,it is easy if we r using Drivers.. If we know which type of database they r using on server side,then we can access that database using related driver...so that the headache willl be reduced am i right??? what is the difference of using driver in place of Webservices On Mar 19, 1:16 am, Bob Kerns r...@acm.org wrote: On Mar 18, 2:37 am, uday kiran uday.pic...@gmail.com wrote: - So for communicatingdatabase(On remote server) from our application - it is compulsory to write a driver like odbc??? No, ODBC (or JDBC) is at the wrong level. You do not want to be doing SQL over the network. Instead, you want to create a web server that does the SQL -- and you just ask it questions (via HTTP GET) or give it commands (PUT, POST, DELETE). If you already know Java well, a Java Servlet would be the easiest way to go -- running in a servlet engine line Tomcat. Tools like Ruby on Rails are supposed to make this even easier, but will involve learning a new language. You're going to have to go and do some studying, and look at a number of examples. I'm not going to look for a pointer to an example for you, because if you do it yourself, you can chose ones that more closely relate to what you're trying to do, or better fit your style of learning. But you can start on the server side by writing a unit test that simply takes a URL, interprets the parameters, and does the corresponding SQL query, and returns the result as either XML or JSON. Once you have that, it's a simple matter to embed that in the appropriate bit of code for your web server technology (e.g. a Servlet, in the case of Java). The client side just requests the data from that URL and reads it. Once you get that far for one kind of data, and the GET operation, the next steps will be both easier and more clear to you. Part of your problem right now is you're trying to deal with the entire question at once. -- 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 To unsubscribe from this group, send email to android-developers+unsubscribegooglegroups.com or reply to this email with the words REMOVE ME as the subject.
[android-developers] Re: Accessing External Database
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
[android-developers] Accessing External Database
Hi folks, Im new bie to android.. i want to access external database from 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 -- 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
[android-developers] Re: Accessing External Database
Thanks for ur quick reply jim.. I want to access an existing database which is present on some server.. Cheers Uday On Mar 17, 6:51 pm, Jim Blackler jimblack...@gmail.com wrote: Hi Uday Is there an existing, specific external database that you wish to access? Or do you wish to set up a new database? Jim On 17 March 2010 13:32, uday kiran uday.pic...@gmail.com wrote: Hi folks, Im new bie to android.. i want to access external database from 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 -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en- 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
[android-developers] Re: Accessing External Database
YES..The database is present on the internet only.. The database should be in SQLite..OS is windows.. On Mar 17, 6:59 pm, Jim Blackler jimblack...@gmail.com wrote: OK what can you tell us about this database. Is it on the internet? What software is it running? On 17 March 2010 13:54, uday kiran uday.pic...@gmail.com wrote: Thanks for ur quick reply jim.. I want to access an existing database which is present on some server.. Cheers Uday On Mar 17, 6:51 pm, Jim Blackler jimblack...@gmail.com wrote: Hi Uday Is there an existing, specific external database that you wish to access? Or do you wish to set up a new database? Jim On 17 March 2010 13:32, uday kiran uday.pic...@gmail.com wrote: Hi folks, Im new bie to android.. i want to access external database from 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 -- 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.comandroid-developers%2bunsubscr...@googlegroups.com android-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en-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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en- 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
[android-developers] Re: Accessing External Database
As of my knowledge in android we use HttpURLConnection to connect to the database in the internet.. am i right Jim?? On Mar 17, 7:05 pm, uday kiran uday.pic...@gmail.com wrote: YES..The database is present on the internet only.. The database should be in SQLite..OS is windows.. On Mar 17, 6:59 pm, Jim Blackler jimblack...@gmail.com wrote: OK what can you tell us about this database. Is it on the internet? What software is it running? On 17 March 2010 13:54, uday kiran uday.pic...@gmail.com wrote: Thanks for ur quick reply jim.. I want to access an existing database which is present on some server.. Cheers Uday On Mar 17, 6:51 pm, Jim Blackler jimblack...@gmail.com wrote: Hi Uday Is there an existing, specific external database that you wish to access? Or do you wish to set up a new database? Jim On 17 March 2010 13:32, uday kiran uday.pic...@gmail.com wrote: Hi folks, Im new bie to android.. i want to access external database from 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 -- 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.comandroid-developers%2bunsubscr...@googlegroups.com android-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en-Hidequoted 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en-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
[android-developers] Re: Accessing External Database
OK... u have any example code which is used to work on this concept?? On Mar 17, 7:11 pm, Jim Blackler jimblack...@gmail.com wrote: Provided the database exposes an HTTP-based API, yes. On 17 March 2010 14:09, uday kiran uday.pic...@gmail.com wrote: As of my knowledge in android we use HttpURLConnection to connect to the database in the internet.. am i right Jim?? On Mar 17, 7:05 pm, uday kiran uday.pic...@gmail.com wrote: YES..The database is present on the internet only.. The database should be in SQLite..OS is windows.. On Mar 17, 6:59 pm, Jim Blackler jimblack...@gmail.com wrote: OK what can you tell us about this database. Is it on the internet? What software is it running? On 17 March 2010 13:54, uday kiran uday.pic...@gmail.com wrote: Thanks for ur quick reply jim.. I want to access an existing database which is present on some server.. Cheers Uday On Mar 17, 6:51 pm, Jim Blackler jimblack...@gmail.com wrote: Hi Uday Is there an existing, specific external database that you wish to access? Or do you wish to set up a new database? Jim On 17 March 2010 13:32, uday kiran uday.pic...@gmail.com wrote: Hi folks, Im new bie to android.. i want to access external database from 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 -- 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.comandroid-developers%2bunsubscr...@googlegroups.com android-developers%2bunsubscr...@googlegroups.com android-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en-Hidequoted 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.comandroid-developers%2bunsubscr...@googlegroups.com android-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en-Hidequoted 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en- 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
[android-developers] Re: Accessing External Database
okk. i may get the quick reference if i go to http://developer.android.com site?? Where this funtionality is to be added in android code?? in onCreate() method? On Mar 17, 7:16 pm, Jim Blackler jimblack...@gmail.com wrote: Hi Uday, I have to bow out here because this is too general a question for this list really. There are a great many ways to do what you are describing. I'd recommend getting a textbook or two on the topic. On 17 March 2010 14:13, uday kiran uday.pic...@gmail.com wrote: OK... u have any example code which is used to work on this concept?? On Mar 17, 7:11 pm, Jim Blackler jimblack...@gmail.com wrote: Provided the database exposes an HTTP-based API, yes. On 17 March 2010 14:09, uday kiran uday.pic...@gmail.com wrote: As of my knowledge in android we use HttpURLConnection to connect to the database in the internet.. am i right Jim?? On Mar 17, 7:05 pm, uday kiran uday.pic...@gmail.com wrote: YES..The database is present on the internet only.. The database should be in SQLite..OS is windows.. On Mar 17, 6:59 pm, Jim Blackler jimblack...@gmail.com wrote: OK what can you tell us about this database. Is it on the internet? What software is it running? On 17 March 2010 13:54, uday kiran uday.pic...@gmail.com wrote: Thanks for ur quick reply jim.. I want to access an existing database which is present on some server.. Cheers Uday On Mar 17, 6:51 pm, Jim Blackler jimblack...@gmail.com wrote: Hi Uday Is there an existing, specific external database that you wish to access? Or do you wish to set up a new database? Jim On 17 March 2010 13:32, uday kiran uday.pic...@gmail.com wrote: Hi folks, Im new bie to android.. i want to access external database from 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 -- 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.comandroid-developers%2bunsubscr...@googlegroups.com android-developers%2bunsubscr...@googlegroups.com android-developers%2bunsubscr...@googlegroups.com android-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en-Hidequoted 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.comandroid-developers%2bunsubscr...@googlegroups.com android-developers%2bunsubscr...@googlegroups.com android-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en-Hidequoted 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.comandroid-developers%2bunsubscr...@googlegroups.com android-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en-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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en- 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] Re: Accessing External Database
Thanks Bob, I got very good information from this... Let me explain thing i want to do.. There is a database present at some IP http://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 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 - -- 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
[android-developers] screen Oroentation
Hi guys.. In my application i want to do Screen Orientation public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); setContentView(R.layout.screen1_landscape); } This is the function that im using in onCreate() method. But when i use this it is showing an error like - Syntax error on token ), ; expected - Syntax error on token (, ; expected - void is an invalid type for the variable onConfigurationChanged Its an important task..could anyone please respond to resolve my issue Any help appreciated -- 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
[android-developers] Screen Orientation in Android
Hi All.. Im facing some problems on Screen Orientation in android. In my application one screen contains Name,Age(as EditTexts). When i click on Name EditText internal Keypad is opening and some of the buttons are hiding due to that keypad. I have some questions regarding this. 1) Whether i need to shrink the application screen as per the keypad layout?? 2) How much space the keypad will occupy?? 3) How to change from Portrait mode to landscape mode dynamically?? So Please help me to resolve the issue. Any help greatly appreciated... Thanks in advance -- 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
[android-developers] Re: Switching between activities
Hi TreKing.. Thanks for the reply..sorry im using EditTexts to enter the data..the information is not retained. i will send both XML file and .java file and let me know the bug in my files. On Feb 11, 11:36 pm, TreKing treking...@gmail.com wrote: On Thu, Feb 11, 2010 at 2:55 AM, uday kiran uday.pic...@gmail.com wrote: What i want to do is.. in Activity1 which is in Screen1 i have entered some data like Name,Age (all are in textview) Are you sure it's TextView you're using and not EditTexts? If you're manually entering information I would expect it to be the latter. and after i moved to Activity2 in Screen2 ..when i clicked Previous button in Screen2 the Activity1 in Screen1 has to be opened and it has to display the details what i entered previously. If you're actually using EditText's, they should retain the information you placed in them automatically. If this is not the case you should elaborate on how you're filling in this data and / or post some code. Pls help me out Its very urgent.. I doubt that =P - TreKing - Chicago transit tracking app for Android-powered deviceshttp://sites.google.com/site/rezmobileapps/treking -- 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
[android-developers] Re: Switching between activities
Hi jotobjects thanks for the reply.. actually im using EditTexts not TextView.. sorry for the wrong information. On Feb 13, 1:24 am, jotobjects jotobje...@gmail.com wrote: Possibly setting android:freeezesText resolves this issue? http://developer.android.com/reference/android/widget/TextView.html#a... On Feb 11, 10:36 am, TreKing treking...@gmail.com wrote: On Thu, Feb 11, 2010 at 2:55 AM, uday kiran uday.pic...@gmail.com wrote: What i want to do is.. in Activity1 which is in Screen1 i have entered some data like Name,Age (all are in textview) Are you sure it's TextView you're using and not EditTexts? If you're manually entering information I would expect it to be the latter. and after i moved to Activity2 in Screen2 ..when i clicked Previous button in Screen2 the Activity1 in Screen1 has to be opened and it has to display the details what i entered previously. If you're actually using EditText's, they should retain the information you placed in them automatically. If this is not the case you should elaborate on how you're filling in this data and / or post some code. Pls help me out Its very urgent.. I doubt that =P - TreKing - Chicago transit tracking app for Android-powered deviceshttp://sites.google.com/site/rezmobileapps/treking -- 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
[android-developers] Switching between activities
Hi All, Im new bee to android development..I have a small issue when switching from one activity to another.. What i want to do is.. in Activity1 which is in Screen1 i have entered some data like Name,Age (all are in textview) and after i moved to Activity2 in Screen2 ..when i clicked Previous button in Screen2 the Activity1 in Screen1 has to be opened and it has to display the details what i entered previously. I successfully transfered the information from Screen1 to Screen2 by using putExtra(),getExtras() How to display the text entered in Screen1 that was entered preoviously. Pls help me out Its very urgent.. Thanks for the information in advance --Cheers Uday -- 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