Dropbox android sdk documentation - java

I have been doing some research, and for the life of me, I cannot find any documentation on how to use the android dropbox SDK. I have authenticated the user, but now I cannot figure out how the get the metadata (file entries) of a folder. I have looked at the Web docs, but the arguments in java are turned around, flipped over, and then some.
In objective-c, the methods are straight forward, and I understand what is going on. Must I port the code from objective-c to java?

As far as I can tell as of Sep 20, 2011, Dropbox still hasn't put the Android SDK documentation. Here are some workarounds:
This guy created his own version based on the official Dropbox SDK. https://github.com/mlamina/DropboxSDK-for-Android
This forum post gives some tips. In particular, they suggest looking at the Python documentation. http://forums.dropbox.com/topic.php?id=25318
[EDIT by anotheranon user]
My friend stumbled upon this official documentation from Dropbox. Don't even know how he found it. Since this thread is also where I gave up I would like to share!

You should be to find your answer here: https://www.dropbox.com/developers. Looks like the SDK is undocumented.
Try making the calls to the API directly.

In the SDK (DropboxSample), this will list the files in the Public folder of the user account:
In DropboxSample.java add:
public void displayFiles(DropboxAPI.Account account) {
if (account != null) {
DropboxAPI.Entry dbe = api.metadata("dropbox", "/Public", 10000, null, true);
List<Entry> contents = dbe.contents;
if (contents != null) {
for (Entry ent:contents) {
Toast.makeText(this, ent.fileName(), Toast.LENGTH_SHORT).show();
}
}
}
}
In LoginAsyncTask.java add:
mDropboxSample.displayFiles(mAccount);
below mDropboxSample.displayAccountInfo(mAccount);

Related

Vaadin-14: checking if client is a mobile device

i am developing a webapp and i want to separate UIs for desktops and mobile devices, so i want to check wether the client using my app is a mobile device or not.
I tried to look online for official documentation or vaadin forum , but i couldn't find any useful information, since almost all of the solutions proposed in those answers are not implementable any more (the methods were removed).
You can use VaadinSession.getCurrent().getBrowser() to see if your client is a phone or not.
public boolean isMobileDevice() {
WebBrowser webBrowser = VaadinSession.getCurrent().getBrowser();
return webBrowser.isAndroid() || webBrowser.isIPhone() || webBrowser.isWindowsPhone();
}
If anyone is interested i found a way around CSS, even if i think it's a bit limited.
I used HttpServletRequest, VaadinService and VaadinServletRequest: I basically checked if words like "Mobile", "iPhone" or "Android" are in the request.
It's not an elegant solution, but it works. This is the code:
public static boolean isPhone(HttpServletRequest request) {
String url = request.getHeader("User-Agent");
return (url.contains("iPhone") || url.contains("Android"));
}

public Google Drive link to file in Java - How to generate it?

How to generate Google Drive share links to a file with Java. I could not find any solution in other posts. All I saw was solutions in other programming languages but not in Java. Anybody has an idea?
Check out my adapted class on Github:
https://github.com/otakuu/sz2pdf/blob/master/src/main/java/sz2pdf/UploadGoogleDrive.java
I guess, you'll find there what you need.
public String getUploadFileLink() {
return "https://drive.google.com/file/d/" + uploadedFile.getId() + "/view";
}

Latest Google Maps API V3 (other than gwt-maps 3.10.0-alpha-7) compatible to GWT 2.7.0?

I'm using GWT (version 2.7.0) and gwt-maps (version 3.10.0-alpha-7) in an effort to display a Google Map via GWT.
I tried following code for map implementation but not able to show map widget :-
Geolocation location = Geolocation.getIfSupported();
location.getCurrentPosition(new Callback<Position, PositionError>() {
#Override
public void onSuccess(Position result) {
try {
latitude = result.getCoordinates().getLatitude();
longitude = result.getCoordinates().getLongitude();
MapOptions options = MapOptions.newInstance();
options.setDraggable(true);
options.setMapTypeControl(true);
options.setScaleControl(true);
map = MapWidget.newInstance(MapImpl.newInstance(mapHPanel.getElement(), options));
map.setCenter(LatLng.newInstance(latitude, longitude));
map.setZoom(6);
map.setMapTypeId(MapTypeId.SATELLITE);
map.setSize("500PX", "500px");
} catch (Exception e) {
}
}
Which one would you guys suggest?
Does somebody maybe had a similar problem and a solution for this? How can I get the Google Maps V3 API working in my GWT project?
Thank you very much guys for any help on this!
I know this is an old question, but just in case anyone comes by from a search engine.
You need an api key, which you should give to the load funcion like
LoadApi.go(onLoad, loadLibraries,true,"key=GET_YOUR_GOOGLE_KEY_AND_INSERT_IT_HERE");
Also please don't shallow exceptions. If you had printed the exception instead of ignoring it, you would have seen the error message telling you that you need a key.

Find the code that this line is referring to?

This is a batch downloader for images on Flickr. I'm curious about how the program gets the original url, so looking through the source code (Favorites.java line 271) I see this, but I wasn't able to find what it's referring to.
String originalUrl = null;
try {
originalUrl = curPhoto.getOriginalUrl();
} catch (FlickrException e) {
// if the original url just isn't available, fine. no need
// to panic.
}
https://github.com/magnusvk/flickrfaves
I'm using Netbeans right now and it's not finding anything when I click on any of the Navigate > Go To buttons on curPhoto. I'd imagine there's an easy way to find the code that it's referring to, but I don't really know what to search on google to learn how to do it.
My question is, where can I find the code for curPhoto.getOriginalUrl() and how should I be finding things like this on my own?
Looks like they are using flickrj to interface with Flickr.
curPhoto is of type Photo, and if you look in the imports, Photo is imported as import com.aetrion.flickr.photos.Photo;. I did a google search for com.aetrion.flickr and it turned up that library.
The documentation for that function can be found here

Add contact/friend in skype using api in Java

I want to add new contact to a skype account using java with skype api.
Is there any java package available to use for the objective?
Also if there is any sample code available for it please share the link
Thanks in advance
public void sendFriendRequest(String skypeId) throws SkypeException {
Skype.getContactList().addFriend(skypeId, "Confirmation message here, etc! :D");
}
it should be on line 198 on - https://github.com/taksan/skype-java-api/blob/master/src/main/java/com/skype/ContactList.java
Just realize that its a different Skype-API. Sorry.

Categories

Resources