http-link to private Dropbox files - android

i'm using the Dropbox Core Api for Android.
I want to generate a http-link to private files, so i can place it in text documents.
So the link opens the browser, which handles authentication.
if i browse the webinterface, i get a link like https://dl-web.dropbox.com/get/########?_subject_uid=#####&w=#############
Is there a way to do that with the Android Api?
Shared Links are no solution! (no /shares or /media )
Thanks...

No, the Dropbox API doesn't currently offer anything exactly like what you describe. If you need to access file content from your app, the best way to do so is using the /files (GET) API call, which returns the file data directly:
HTTP docs: https://www.dropbox.com/developers/core/docs#files-GET
Android docs: https://www.dropbox.com/static/developers/dropbox-android-sdk-1.6.2-docs/com/dropbox/client2/DropboxAPI.html#getFile(java.lang.String, java.lang.String, java.io.OutputStream, com.dropbox.client2.ProgressListener)
If you need a link to the data, the next best option is /media:
HTTP docs: https://www.dropbox.com/developers/core/docs#media
Android docs: https://www.dropbox.com/static/developers/dropbox-android-sdk-1.6.2-docs/com/dropbox/client2/DropboxAPI.html#media(java.lang.String, boolean)
The links returned by /media aren't share links, exactly, as they automatically expire after four hours and aren't listed on https://www.dropbox.com/links . Further, calling /media also doesn't automatically make the files non-private, as one would need the (reasonably unguessable) link to access it.

Related

Download Google doc file to device

I am trying to download a doc.google file to my device, however I can't figure the best way for that..
First: I created an Auth key to my Drive following this tutorial
Then: I am trying to follow this tutorial to download the file, but It is not going well
I want to connect to this Auth key through the app and download/Export the file automatically without prompting the user to choose account or anything..
This is the URL for the doc file:
https://docs.google.com/spreadsheets/d/1QJTna4iz-VivwAzwgq7V5QDs2XbgM2lEFPEG7NqCPdo/
Thanks in advance
Try the method used in this SO post.
It was cited that to overcome the google problem when setting the file publicly. As in the post:
If you set the file permissions to be publicly available and
create/generate a direct access link by using something like the
gdocs2direct tool or just crafting the link yourself:
https://docs.google.com/uc?export=download&id=<your file id>
You will get a cookie based verification code and prompt "Google could
not scan this file" prompt, which won't work for things such as
wget or Vagrantfile configs.
The code that it generates is a simple code that appends GET query
variable ...&confirm=### to the string, but it's per user specific,
so it's not like you can copy/paste that query variable for others.
The specified web page hosting method will suffice.

DFL parameter in Firebase Dynamic Links Builder

I need to programmatically build a dynamic link using the Dynamic Link Builder API on Android (https://firebase.google.com/docs/dynamic-links/android/create). This is the only option applicable for my case since I need to track click data and shorten links.
This link can be opened on the desktop, but the problem is that the link will be eligible only for mobile apps - the website is unable to recognize this link (this behavior is intentional). I would like the desktop user is directed to the website's main page.
Here is the quote from Firebase doc:
When users open a Dynamic Link on a desktop web browser, they will load this URL (unless param dfl is specified). If you don't have a web equivalent to the linked content, the URL doesn't need to point to a valid web resource. In this situation, you should set up a redirect from this URL to, for example, your home page.
I see I need dfl parameter. (dfl is The link to open on desktop, overriding param link.) How can I specify dfl parameter using Dynamic Links Builder on Android?
I know that I can specify dfl by building dynamic link manually - https://firebase.google.com/docs/dynamic-links/create-manually
But this approach is not useful for me since it has such constraints:
If you don't need to track click data in the Firebase console and you don't care if the links are long...
Does anybody know the right solution or some trick to achieve this? Any thoughts/ideas would be appreciated!
Seems, that simple appending does work...
When the builder composes the Uri, I append it with &dfl=XXXXX
When I try to open this link on browser PC it directs me to URL in dfl parameter, but on the device, it opens Play Store or app (if it's installed).
The absence of such method confused me, but the solution is found.

What to put for website when registering android app with instagram api?

I am new to Android and am confused on what to put for the URL fields when registering a new client with the Instagram API using their web form.
I'm specifically confused as to what to put for these fields:
Website URL
Valid Redirect URIs
I am making an Android app and it doesn't have a website, so what am I supposed to be putting here?
In my search for an answer that made sense to me, I found this: http://oferei.com/2013/06/serverless-instagram-authentication/
In short, this is what one would need to know about how to fill these fields if they are registering an app that does not have its own website:
Website URL: it doesn't matter what value goes here, I used localhost
Redirect URIs: The article above specifies a custom URI scheme, but this is not supported w/ the Instagram API anymore. However, I did see that also using localhost would work here as well in this article: http://jelled.com/instagram/access-token
Not sure if that is the best practice, but it is a way to get the client ID for an Android app.

APP URI for app Indexing an android app

I have an android application. I want to implement App Indexing for my App.
I have followed the Google developer links
https://developers.google.com/app-indexing/android/publish
https://developers.google.com/app-indexing/reference/deeplinks
https://developer.android.com/training/app-indexing/deep-linking.html
https://support.google.com/googleplay/android-developer/answer/6041489
I got to know few things from the links
I need to verify my website
Use app indexing API in my Activity
The things that I did not understand
What is the website should I verify?
what should I give for APP_URI & WEB_URL?
static final Uri APP_URI = Uri.parse("android-app://com.example.android.recipes/http/recipe-app.com/recipes");
static final Uri WEB_URL = Uri.parse("http://recipe-app.com/recipes/");
What is the Schema to host my links?
android-app://{package_name}/{scheme}/{host_path}
What is the 'data' should I give in Manifest file.
Think I'm very New to to android development. Any examples are most helpful. Thanks in Advance.
So you already started well using Google's provided example to better understand how App-Indexing works. With that covered, I'd recommend you to follow also the best pratices present here:
https://developer.android.com/training/app-indexing/index.html .
Now, answering to your points:
1- As you saw with Google's example, it is required that your App has corresponding content on the web that has also been indexed by Google. In this case, the website is:
http://recipe-app.com
It would be best if you verify both the app & the website. Information on how to associate your website to your App is present in https://developers.google.com/app-indexing/android/publish
Currently App-Indexing only supports Apps that have correspondent websites. However, if you don't have a website you can still show your interest in support App-Indexing in your App by submitting this form https://developers.google.com/app-indexing/app-only .
2- Google advises to use the App-Indexing API and the HTTP intent scheme as best practices, so in this case you will only need the APP_URI. Also with this kind of implementation, you would not need to make any change on the website markup or sitemap. So in each of your App page you should indicate the APP_URI with the URI of the correspondent content in your website.
3- Assuming you're using the HTTP scheme, your deep link would be similar to this:
android-app://my.app.apk/http/mywebsite.com/sub-domain/content1.html
4- The data parameter on your app's manifest file is where you define the deep link intents that your app supports, so using the example of deep link I provided on 3), it should be similar to this:
<data android:scheme="http"
android:host="mywebsite.com"
android:pathPrefix="/sub-domain" />
This intent will support any web URL that start by:
http://mywebsite.com/sub-domain/
Hope this helps.
I think it would be better as follow:
android-app://my.app.apk/http/sub-domain.mywebsite.com/content1.html

Which Android library for twitter is easiest to work with?

There is
com.sugree.twitter, java me api
I have used Twitter4j
Click on the following link to get source code
http://automateddeveloper.blogspot.com/2011/06/android-twitter-oauth-authentication.html
You should go for Twitter4j OAuth
OAuth is an open protocol which allows
the users to share their private
information and assets like photos,
videos etc. with another site without
sharing their credentials (username
and password) to the latter. Hence
making it very secure way of
transmission of data..
here is link for this...
http://www.xoriant.com/blog/mobile-application-development/twitter4j-oauth-on-android.html

Categories

Resources