I am developing an Android application for a facebook page. More specifically I want to display post images as part of a feed. The way I have achieved this thus far is by using restfb along with Graph API, making requests to Graph API, receiving the images and displaying them to the feed.
My concerns are the following:
I heavily rely on the access token facebook gives me for accessing those images and other page data.
Whether, if theoretically the traffic of the application increases, can it be supported by Graph API, both performance-wise and logic-wise(extension of the access token troubles me for multiple devices).
Considering the above I have decided to go with a server-based approach. That means storing just images to the server instead of posting them on facebook. Is there an Android specific approach when building a server? Any specific documentation I should read?
UPDATE:
I decided to go with a Firebase Storage approach where I will upload images to the Storage and download them into my application.
Related
I have just developed a new Android app for my company.
On the home page of the app we would like to display a number of our companies latest Facebook posts.
When send the request to the API i am receiving the error
"message": "(#200) Access to this data is temporarily disabled for non-active apps or apps that have not recently accessed this data due to changes we are making to the Facebook Platform. https://developers.facebook.com/status/issues/205942813488872/"
I have looked into this extensively and understand it is due to Facebook upgrading their APIs due to the recent data breach.
Within the app i have successfully implemented the Facebook Login API and can retrieve a new access token for the user.
I have generated all the necessary hash keys for the android app and have set it all up correctly on the facebook developer console.
I can achieve the functionality i require by getting the Access token from the Facebook developers Graph API Explorer however, this is not a good implementation as it is linked to my Facebook account and also only lasts for an hour.
The Facebook API states that public pages can be accessible using any user access token.
Is there currently anyway at all to use a user access token generated from the user login to retrieve a Facebook page data.
the only data i wish to retrieve is; the message, the time created and the image.
Is this possible with the current state of the Graph API or is it just a waiting game to see what Facebook will do next in the coming weeks?
Thanks.
I am coming from java based web application background where client is thin client i.e. browser and all UI pages(HTML,CSS,JS) along with
data comes from server. But with recent read on net about android based mobile apps and based on Q/A on stack overflow came with this understanding
Android app with backend(where data is fetched from server) is like two application communicating with each other on http. When I say two app , these
are one on mobile which is java(android) application and second is on server which is generally exposed through web services which can be in any language
like java/dot net. Is it correct ?
If yes I have one doubt when comparing it with java server based web app This is in regard of where UI pages . In web application,
UI views are returned from server in the forms of HTML. But I am confused where UI pages resides in android app. Is it generally on client side(all ui pages
are downloaded with app . With different events app serves the UI from client side itself but data comes from server) or they are served from server ?
If from server are they served again as HTML or there is some other format that android better gels with ?
May be android app generally should not expect any UI pages from server which means downloaded app should have all UI pages with it.
I think the UI is still on the client while the content for filling of the UI is from the server. This content is transported in HTTP(s) protocol, therefore in HTML format as you said. But one can use other protocols to get the response from the server I guess.
I'm developing a knowledge base java application, where I can store and retrieve annotations with its title, date when the note was created (SQL datetime), content, tags about the annotation, etc.
It can be done easily with a database (I'm using SQL Server 2014), but the main problem is that the server is running on my own PC and it has to be always on and running the SQL Server. Also, I would like to extend the application by storing and retrieving this kind of data on mobile apps for Android and iOS.
Is there any other way to store that type of data in some files so it can be uploaded to some cloud storage like Dropbox ? After storing it on Dropbox, all I would have to do is sync the app with dropbox, get the files and read/write stuff.
UPDATE: Thanks for all the answers they helped me a lot. The best solution for me is to replace SQL Server with SQlite, as Gabe Sechan commented. Now I can make changes on the database without the need of a server running 24/7 and I can use the same database on Android and iOS apps.
You can use just a basic ajax call to pull content from a Dropbox "public" URL.
function(contenturl,intoselector,callback){
if (contentwindow.currenttopic!==contentID){
jQuery.ajax({
type:'GET',
url:'//www.corsproxy.com/'+contenturl,
dataType:'text',
async:true,
success:function(data){
intoselector.html(data);
if (jQuery.type(callback)==="function")
callback();
}
});
}
Notice that this example pulls through corsproxy so that you don't receive any XSS errors, so the url you pass needs to not contain a protocol itself.
If you want to pull a JSON or XML string that is stored in the file, then you might need to play around with the dataType and contenttype options in the ajax call.
This can also be done using Google spreadsheets:
Reading:
Create a spreadsheet and publish it on the web
Use one of the many available Javascript libraries for pulling data from Google spreadsheets:
http://jlord.us/sheetsee.js/ (which uses Tabletop.js)
http://chriszarate.github.io/sheetrock/
Writing:
You can use a Google app script for writing to the spreadsheet (reference) OR
You can create a Google form linked to the spreadsheet and simply fill the form from your mobile app whenever you want to add some data to the sheet (reference)
Of all the cloud services, when it comes to Android, Dropbox's Sync API is one of the easiest to implement. Do you need specific code examples on how to sync with Dropbox?
I am new to Java and Android. I am just beginning work on an app that will save information to a server that someone else from within the same company can retrieve using the same app from a different android device. I know how to simply store data on a server using simple php scripts but this is a bit more complex and involves one user writing information to the server, while another user can see / download it. Within a company there would be multiple users who have acceess to this data. So my question would be, whats the best way to implement a company-wide database that ONLY members of the same company can have access to? Sorry if this seems obvious to some of you. I am just getting started and I have 7 books on android programming and none of them describe how to do quite what I am trying to do.
To do this you need to use Android network services to access data. In other words to retrieve a networked database information your device will connect to your service with a specified URL and arguments. In turn, the service will reply with the required data, say may be in XML format. All your app needs to do is parse the XMl and display the date as desired.
Same thing applies to putting data into the server, in this case however the data will be sent as arguments to the network service URL and the service will handle the persistence to a database.
My advise is to do a Google search of the keyword "Android Network Services".
Before downvoting, please note that I am only asking for expert opinion, and not the source code.
I am working on an android app which will sync contacts/sms/mms on a webserver.
Which of the web service technologies is suitable for this app and easy to parse on server side?
Is it correct to convert contacts etc to a text file before sending to the server as I may not be able to convert mms and picture messages to a text file?
I want users to restore their data from the server. Will there be any problem regarding data format while downloading data to mobile?
REST web services are generally the best way to go for mobile devices as they are light weight meaning they require less processing and phone resources to use when parsing responses in JSON.
Heres a link to a question that deals with accepting an attachment over a REST web service in java
How do I write a restful web service that accepts a binary file (pdf)
However REST isn't as secure as SOAP, given its going to be personal data you may want to consider this. Also from experience of whats been happening in the news with this kind of data being taken off of phones you may want to consider not doing this at all as it can become a data privacy law nightmare.