How to update app content whenever website is updated - Java for Android App Development

Am working on a news reader app and the should synchronize with with the webserver such that whenever the desktop site is updated the also picks the update. What is the best approach to this? Thanks for the help.

If the webserver can output XML, JSON or even an RSS feed, you could grab it from the server , parse it and display it in your app.
Sent from my SGH-I337M using xda app-developers app

An RSS feed is probably the easiest and quickest way to implement.
The best practice would probably be to expose a JSON/RPC API which your app can call when it's started and depending, for example, on a version code parameter of the JSON object, will retrieve the rest of the information or not if the version code is the same as last time (ie: saved in SharedPreferences)

Cool. Thanks for the input. You just explained what I have in mind but I have no idea on what the code would look like. Any help with that? Thanks

blissville said:
Cool. Thanks for the input. You just explained what I have in mind but I have no idea on what the code would look like. Any help with that? Thanks
Click to expand...
Click to collapse
Are you also the developer of the website you want to synchronize with or do you want to collect news from any arbitrary site?

Am collecting news from an arbitrary site
Sent from my Nexus 7 using xda app-developers app

blissville said:
Am collecting news from an arbitrary site
Sent from my Nexus 7 using xda app-developers app
Click to expand...
Click to collapse
Then i think the best and most common way is catching your data via RSS.
But you should check if your targeted news site allows the usage of their content in third party apps.
You can retrieve the RSS files with simple http requests. It contains XML with the news your want to provide and additionally meta data like the publishing dates.
For example the XDA RSS file:
http://forum.xda-developers.com/external.php?type=RSS2

You can also parse information in your own server, gathering information there and providing info to the app. This way at least you don't consume brandwith of the sites you are gathering information from.

Related

App inventor

Got accepted to app inventor.. any ideas for a project?
Sent from my PC36100 using XDA App
Tcf bank app, ps3 keyboard, wifi cracking(lol would come in handy when I'm not home), and game informer let you know release dates for games if that's not out yet. That's all I can think of for now I'll let you know if I think of anything else....oh yea is it pssible to port tap tap revenge to android?
Sent from my PC36100 using XDA App
have you completed the demos/tutorials yet Mr Gates?
SMS Librarian.
A texting archival service. Allowing you backup and restore sms. Allows filtering by dates and contacts. restore some of your sms or only sms by certain contacts or certain ones in a date range or all in a date range.
allows exporting sms to pdf or rtf or html
with time stamping ( for court for a restraining order for example)
and you can keep archiving either by wifi or 3g or bluetooth or you could have it by plugging your phone into usb or whatever.
This is something android lacks in any decent from.
Working on the demos and tutorials now. It's pretty neat.
Sent from my PC36100 using XDA App
rejectedkid said:
Working on the demos and tutorials now. It's pretty neat.
Sent from my PC36100 using XDA App
Click to expand...
Click to collapse
Once you finish those tutorials you will realize how limited you are in the type of apps you can create with appinventor.
Keep in mind appinventor was not meant to make full fledged apps but give novices an easier time understanding how to create simple apps and what goes on when needing to initiate calls during specific conditions/events.
I played with appinventor and still use it when I am bored, but as far as making actual apps, I do it in ms visual studio.
futuristicstyles said:
ps3 keyboard, wifi cracking
Click to expand...
Click to collapse
+1
10freakinChar
I got accepted over a month ago and it is a pretty cool setup. But until we can use multiple windows and rotation isn't broken then it is just a novelty.
But truthfully it is very cool, to program without knowing Java.
i could use an app that will give me bluetooth hid support on sense stock rooted rom, so we could use hid and not spp bluetooth keyboards on our devices.
cm6 roms supports this. but i want to stay close to stock
there is a company that claims they have an app for this but it doesnt work.
lovethyEVO said:
Once you finish those tutorials you will realize how limited you are in the type of apps you can create with appinventor.
Keep in mind appinventor was not meant to make full fledged apps but give novices an easier time understanding how to create simple apps and what goes on when needing to initiate calls during specific conditions/events.
I played with appinventor and still use it when I am bored, but as far as making actual apps, I do it in ms visual studio.
Click to expand...
Click to collapse
Is there a good book/tutorial etc for getting into android programming? I'm familiar with ms visual studio, so working in there will at least lessen the learning curve somewhat,

lloydstsb banking problem

Hi all, first post so go easy on me not sure i'm in the right forum, had my dhd for about two weeks now and can't fault the phone, but tried to get internet banking on it and can't seem to get it to download, I followed all of the instructions on the lloydstsb website and I get as far as downloading a file (downloadclient.jad) but when I try to open it the phone asks me to complete action using either DB editor or file editor, if I then open it with either I just get a load of text? i'm stuck, any help would be great.
P.s the program is monitise
Thanks hOOter343.............
Just go through the site as you normally would.
Change your browser to non-mobile view in the settings.
Just make sure your on https and not on a public wifi network.
I didn't bother with the app, lose your phone and your buggered.
Thanks flacid monkey, will do that it seems safer.
hOOter343...
hooter343 said:
Thanks flacid monkey, will do that it seems safer.
hOOter343...
Click to expand...
Click to collapse
FYI, a .jad is an exacutable java application, if you want to run it on your device you will need a JRE like jbed
can someone plee post the lloyds apk or pm with it
Strange mine installed fine?
Sent from my Desire HD using XDA App
Please can someone upload the apk for lloyds tsb mobile banking as i am outside the UK.
Sent from my LG-P920 using XDA App
They have stopped the app. They are only providing mobile website now.

[Library] RateMyApp

After attending a talk about how to market our applications in better ways I just published a library I developed to ask users to users a rating on the Play Store.
It is extremely simple. It keeps track of the first time the application has been used and a counter of the number of times the application has been launched.
You can configure when you want to ask the user to rate your application both in term of number of launches and days from the installation.
When the conditions are met, the library creates a dialog with a button to open the Play Store page of the application, a button to postpone the alert and a button to dismiss it and never get asked again.
You can get the library from GitHub.
Feedbacks and recommendation about how I could improve it are very welcome.
mariosangiorgio said:
After attending a talk about how to market our applications in better ways I just published a library I developed to ask users to users a rating on the Play Store.
It is extremely simple. It keeps track of the first time the application has been used and a counter of the number of times the application has been launched.
You can configure when you want to ask the user to rate your application both in term of number of launches and days from the installation.
When the conditions are met, the library creates a dialog with a button to open the Play Store page of the application, a button to postpone the alert and a button to dismiss it and never get asked again.
You can get the library from GitHub.
Feedbacks and recommendation about how I could improve it are very welcome.
Click to expand...
Click to collapse
I will try it, thanks a lot.
Cyclingforfun said:
I will try it, thanks a lot.
Click to expand...
Click to collapse
Great. Let me know what you think about the library.
I hope you won't have any issue but in case you have problems let me know and we will try to sort them out.
Sent from my GT-I9505 using Tapatalk
Hi,
Here the German Translation: dropbox.com/s/jeoqbshoigft840/values-de.zip
- Jan
Screenshot?
bigjan said:
Hi,
Here the German Translation: dropbox.com/s/jeoqbshoigft840/values-de.zip
- Jan
Click to expand...
Click to collapse
Thank you! I'm traveling without my computer and I cannot push your translation to the repository immediately. If you like you can fork the project on github and create a pull request, otherwise I'll integrate your translation as soon as I get back home
Sent from my GT-I9505 using Tapatalk
Looks great! Got a little confused trying to set up in Eclipse, any suggestions? Thanks for your work!
:good:
pangolin.rollin said:
Looks great! Got a little confused trying to set up in Eclipse, any suggestions? Thanks for your work!
:good:
Click to expand...
Click to collapse
Step 1ownload the libraries.
Step 2:-Then copy the .lib file to the android libraries folder in the project tree for the app you are designing.
Step 3:- Happy coding!
There doesnt seem to be a libs folder. I imported the Javas and followed the directions but don't know how to configure the gradle modules cause I'm using eclipse not studio.
Sent from my SPH-L710 using xda app-developers app
Hello, while this is a good idea to ask for a rating, don't harass the user with it, and don't ask it too soon, leave the user some time to poke around
Regards
pangolin.rollin said:
There doesnt seem to be a libs folder. I imported the Javas and followed the directions but don't know how to configure the gradle modules cause I'm using eclipse not studio.
Sent from my SPH-L710 using xda app-developers app
Click to expand...
Click to collapse
I am going to make a compiled version of the library next week as soon as I get back home
Sent from my GT-I9505 using Tapatalk
Magissia said:
Hello, while this is a good idea to ask for a rating, don't harass the user with it, and don't ask it too soon, leave the user some time to poke around
Regards
Click to expand...
Click to collapse
Thanks for pointing it out. It is extremely important and the parameters regulating when the application should ask for a rating should be set with care.
I decided to try to make it the less annoying possible by showing the message only once (if not explicitly deferred by the user) when both the conditions on the number of launches and on the time from the first launch are met.
Do you have any idea about how I could make the message even less annoying?
Sent from my GT-I9505 using Tapatalk
mariosangiorgio said:
Thanks for pointing it out. It is extremely important and the parameters regulating when the application should ask for a rating should be set with care.
I decided to try to make it the less annoying possible by showing the message only once (if not explicitly deferred by the user) when both the conditions on the number of launches and on the time from the first launch are met.
Do you have any idea about how I could make the message even less annoying?
Sent from my GT-I9505 using Tapatalk
Click to expand...
Click to collapse
I guess a good way would be to be to add a little shiny icon, if the user is curious (s)he will tap on this little icon, and that's the moment to display the pop up kindly asking for the review. This nice little icon taking little space somewhere on the screen would appear after a period of use to leave some time to poke around.
It will have the advantage of playing with end user's curiosity, and not aggressively show a pop-up, since the user will trigger it from it's own action.
Application's developer will be able to use something that fit the current interface or game as icon, not throwing the immersion to trash in a brutal way.
Backup plan in case the user isn't curious would be to still show the pop-up the hard way after some more time.
Some usage example could be adding the icon to the levels list in a game, or adding the icon somewhere in the toolbar for a file manager, text editor. Placing it next to a connect button for a social/messaging application.
Regards
Magissia said:
I guess a good way would be to be to add a little shiny icon, if the user is curious (s)he will tap on this little icon, and that's the moment to display the pop up kindly asking for the review. This nice little icon taking little space somewhere on the screen would appear after a period of use to leave some time to poke around.
It will have the advantage of playing with end user's curiosity, and not aggressively show a pop-up, since the user will trigger it from it's own action.
Application's developer will be able to use something that fit the current interface or game as icon, not throwing the immersion to trash in a brutal way.
Backup plan in case the user isn't curious would be to still show the pop-up the hard way after some more time.
Some usage example could be adding the icon to the levels list in a game, or adding the icon somewhere in the toolbar for a file manager, text editor. Placing it next to a connect button for a social/messaging application.
Regards
Click to expand...
Click to collapse
Thanks for your comments. I'm going to support custom ways to show the alert to the user. The library will still contain the alert message but developers will be able to show whatever they want (possibly something less invasive) when the conditions are met
Sent from my GT-I9505 using Tapatalk
What is that you are doing to make sure the dialog will never be displayed twice ?
SagiLo said:
What is that you are doing to make sure the dialog will never be displayed twice ?
Click to expand...
Click to collapse
The library stores its data in a file and when the dialog is marked as processed it sets a flag which disables further notifications.
Actually a user may see the dialog twice on different devices. We could avoid that with the synchronisation of the data file but I don't know if ot is worth the effort
Sent from my GT-I9505 using Tapatalk
mariosangiorgio said:
The library stores its data in a file and when the dialog is marked as processed it sets a flag which disables further notifications.
Actually a user may see the dialog twice on different devices. We could avoid that with the synchronisation of the data file but I don't know if ot is worth the effort
Sent from my GT-I9505 using Tapatalk
Click to expand...
Click to collapse
In a file means its not shared preferences right?
So if the user clears the app data, the file content will live ?
SagiLo said:
In a file means its not shared preferences right?
So if the user clears the app data, the file content will live ?
Click to expand...
Click to collapse
Unfortunately I used shared preferences
I was not thinking at the scenario where the user first uninstalls and then reinstalls an application
Sent from my GT-I9505 using Tapatalk
mariosangiorgio said:
Unfortunately I used shared preferences
I was not thinking at the scenario where the user first uninstalls and then reinstalls an application
Sent from my GT-I9505 using Tapatalk
Click to expand...
Click to collapse
Ok... we can try creating some sub mechanism for that,
I.E. checking a file in external sdcard (requires pernission).
Or getting data from the internet whether the user has already rated or not.
Hello, using Internet or a file somewhere can be a good idea if the application itself already use on of those permissions, but it's not legit for an app to ask for Internet or file access just for this, security wise, we should only give the strict minimum permissions the application need to work.
Regards

Android databases technology

I am app developer and i plan to do application, which uses online database (on server), and i would like to ask, what are the most common used technologies(i mean which SQL databases). Im in touch with MySQL but think it isnt the best solution available. So what is your favourite way to connect your app with database?
//Do you know any good literature with this topic?
JohnDeere1334 said:
I am app developer and i plan to do application, which uses online database (on server), and i would like to ask, what are the most common used technologies(i mean which SQL databases). Im in touch with MySQL but think it isnt the best solution available. So what is your favourite way to connect your app with database?
//Do you know any good literature with this topic?
Click to expand...
Click to collapse
I think you should use GoogleAppEngine it shall simpify things if you dont plan for BIG DATA
Sent from my GT-S5302 using Tapatalk 2
It depends of how much data you plan to store and how many users you plan to have
It depends on connections
JohnDeere1334 said:
I am app developer and i plan to do application, which uses online database (on server), and i would like to ask, what are the most common used technologies(i mean which SQL databases). Im in touch with MySQL but think it isnt the best solution available. So what is your favourite way to connect your app with database?
//Do you know any good literature with this topic?
Click to expand...
Click to collapse
Pool of connections are preferable when your app uses many connections . It's already realized in Java and you may easily use it.
http://forum.xda-developers.com/showthread.php?t=2325799
Sent from my GT-S5570 using XDA Premium 4 mobile app
arpitkh96 said:
http://forum.xda-developers.com/showthread.php?t=2325799
Sent from my GT-S5570 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
That is an extremely limited guide that means a working internet connection has to be present for the app to work on all launches of the app.
A more efficient way of doing it is to put the JSON output into a local SQLite database, therefore effectively mirroring the online one and then make the app read (and write if needed) information from the local database - if you need changes to be written to the local database you would then need to add a post method that parses the local DB to JSON and sends it to the server for the server to update its version of the DB.
This way takes a little more coding but means that you can use the app offline.
Sent from my HTCSensation using Tapatalk
Jonny said:
That is an extremely limited guide that means a working internet connection has to be present for the app to work on all launches of the app.
A more efficient way of doing it is to put the JSON output into a local SQLite database, therefore effectively mirroring the online one and then make the app read (and write if needed) information from the local database - if you need changes to be written to the local database you would then need to add a post method that parses the local DB to JSON and sends it to the server for the server to update its version of the DB.
This way takes a little more coding but means that you can use the app offline.
Sent from my HTCSensation using Tapatalk
Click to expand...
Click to collapse
Depends on the op.wouldnt it be better if app simply downloads the database and use it(if he is only reading it).
Sent from my GT-S5570 using XDA Premium 4 mobile app
arpitkh96 said:
Depends on the op.wouldnt it be better if app simply downloads the database and use it(if he is only reading it).
Sent from my GT-S5570 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
If he could be sure his users would have a constant network connection then maybe, however, my method allows for offline viewing and more control over when the app connects to the internet if its tied into a refresh button for example.
Sent from my HTCSensation using Tapatalk
Jonny said:
If he could be sure his users would have a constant network connection then maybe, however, my method allows for offline viewing and more control over when the app connects to the internet if its tied into a refresh button for example.
Sent from my HTCSensation using Tapatalk
Click to expand...
Click to collapse
Little offtopic
Like if i want to open pdf from a file i use this
Code:
public void openpdf(File f){
if(f.exists()) {
Uri path =Uri.fromFile(f);
Intent intent =new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(path,"application/pdf");
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
try {startActivity(intent);}
catch (ActivityNotFoundException e) {
Toast.makeText(MainActivity.this,"No Application Available to View PDF",Toast.LENGTH_SHORT).show();
}}}
What should i use to open archive files(zip,rar) (from intent).i have tried general method of getting Mime type but that didnt worked
Sent from my GT-S5570 using XDA Premium 4 mobile app
arpitkh96 said:
Little offtopic
Like if i want to open pdf from a file i use this
Code:
public void openpdf(File f){
if(f.exists()) {
Uri path =Uri.fromFile(f);
Intent intent =new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(path,"application/pdf");
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
try {startActivity(intent);}
catch (ActivityNotFoundException e) {
Toast.makeText(MainActivity.this,"No Application Available to View PDF",Toast.LENGTH_SHORT).show();
}}}
What should i use to open archive files(zip,rar) (from intent).i have tried general method of getting Mime type but that didnt worked
Sent from my GT-S5570 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
if you wanted to open it from within the application you could do something like:
Code:
ZipFile z = new ZipFile("/mtn/sdcard/download/teste.zip");
But if you wanted the intent to launch into a different app to handle the zip (eg Archidroid etc) then have you tried something like:
Code:
File file = new File("mnt/sdcard/download/test.zip");
Intent i = new Intent();
i.setAction(android.content.Intent.ACTION_VIEW);
i.setDataAndType(Uri.fromFile(file), "application/zip");
try {
startActivity(i);
} catch (ActivityNotFoundException e) {
Toast.makeText(MainActivity.this,"No Application Available to View Zip files",Toast.LENGTH_SHORT).show();
}
Jonny said:
if you wanted to open it from within the application you could do something like:
Code:
ZipFile z = new ZipFile("/mtn/sdcard/download/teste.zip");
But if you wanted the intent to launch into a different app to handle the zip (eg Archidroid etc) then have you tried something like:
Code:
File file = new File("mnt/sdcard/download/test.zip");
Intent i = new Intent();
i.setAction(android.content.Intent.ACTION_VIEW);
i.setDataAndType(Uri.fromFile(file), "application/zip");
try {
startActivity(i);
} catch (ActivityNotFoundException e) {
Toast.makeText(MainActivity.this,"No Application Available to View Zip files",Toast.LENGTH_SHORT).show();
}
Click to expand...
Click to collapse
Thanks.
One more.l am asking about the method i suggested of downloading the database for readonly purpose.where should i upload the database so that server could handle multiple downloads etc.
Sent from my GT-S5570 using XDA Premium 4 mobile app
arpitkh96 said:
Thanks.
One more.l am asking about the method i suggested of downloading the database for readonly purpose.where should i upload the database so that server could handle multiple downloads etc.
Sent from my GT-S5570 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
I'd have thought just having the database on the server and using the php script to output a JSON response then put the JSON response into a local SQLite database would do that.... I'm not entirely sure what you're asking though
Jonny said:
I'd have thought just having the database on the server and using the php script to output a JSON response then put the JSON response into a local SQLite database would do that.... I'm not entirely sure what you're asking though
Click to expand...
Click to collapse
Have you ever used Dictionary.com app.it has an option for offline mode in which it downloads the whole database into the internal memory to use it any time.i want to do that.I am asking where should i upload that database(server,website etc) so that i could download that easily in myapp
Sent from my GT-S5570 using XDA Premium 4 mobile app
arpitkh96 said:
Have you ever used Dictionary.com app.it has an option for offline mode in which it downloads the whole database into the internal memory to use it any time.i want to do that.I am asking where should i upload that database(server,website etc) so that i could download that easily in myapp
Sent from my GT-S5570 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Ah right I get it, you would need a server with sql support - or at least a hosting package that allows you to add your own database, then just use phpMyAdmin/MySQL to create the database.
Jonny said:
Ah right I get it, you would need a server with sql support - or at least a hosting package that allows you to add your own database, then just use phpMyAdmin/MySQL to create the database.
Click to expand...
Click to collapse
Thats ok.but which server or website can do this.
Sent from my GT-S5570 using XDA Premium 4 mobile app
arpitkh96 said:
Thats ok.but which server or website can do this.
Sent from my GT-S5570 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
2 services I'm currently using are http://www.unlimitedwebhosting.co.uk/ & http://x10premium.com/ - you're probably ok with the low cost options that offer "unlimited" stuff (subject to interpretation and fair use etc) because the overhead on MySQL is not a lot so you probably won't use much bandwidth.
As a general guide pretty much anyone who offers cpanel or similar control software will have MySQL enabled - though be sure to check because hosts have been known to disable MySQL in cpanel before.

[Q] android app idea needed

hi everyone. I am new to this field. And I am needing an idea for developing an android application related to telecommunication field like GPS, 3G, 4G, network, security etc. Kindly suggest me some ideas.
Regards,
Shahrukh
Shahrukhkasi said:
hi everyone. I am new to this field. And I am needing an idea for developing an android application related to telecommunication field like GPS, 3G, 4G, network, security etc. Kindly suggest me some ideas.
Regards,
Shahrukh
Click to expand...
Click to collapse
You can make an app for tracing your device :good:
Further Suggestion
Rick Clephas said:
You can make an app for tracing your device :good:
Click to expand...
Click to collapse
Thank You Rick Celphas for your suggestion. But as I am planning for my final year project I must develop or append some advance features in my application. Initial idea is good, but if you have further suggestion of features, which can be added in this application.
Shahrukhkasi said:
Thank You Rick Celphas for your suggestion. But as I am planning for my final year project I must develop or append some advance features in my application. Initial idea is good, but if you have further suggestion of features, which can be added in this application.
Click to expand...
Click to collapse
Well you could make these options:
Remote access security functions(factory reset, change locmscreen password ...) from other phone by sms or call.
Trace the phone with GPS(from another phone or website)
Get remote control of the camera, sound and vibration.
To get peoples attention and make pictures of the areay the thief is.
You can find alot of things people would like to be able to do when there phone is stolen
Sent from my SM-N9005 using XDA Premium 4 mobile app
Sugestion Appreciated
Rick Clephas said:
Well you could make these options:
Remote access security functions(factory reset, change locmscreen password ...) from other phone by sms or call.
Trace the phone with GPS(from another phone or website)
Get remote control of the camera, sound and vibration.
To get peoples attention and make pictures of the areay the thief is.
You can find alot of things people would like to be able to do when there phone is stolen
Sent from my SM-N9005 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Thanks for your suggestion. Will search further about all suggested app ideas. If any help required will ask.
Start by looking to what would make your daily life more easier and more enjoyable
An app, which shows the nearby cashpoints would be cool.

Categories

Resources