Showing posts with label files. Show all posts
Showing posts with label files. Show all posts

Tuesday, March 10, 2015

Allowing the user to select Google Drive files from your application

If your application needs a way to let users easily choose a file from their Drive, this is for you.

Users can browse and select files from their Drive file list using the Google Picker API. The Google Picker API provides a user interface containing a list of all the users files in Google Drive.

Since the user interface is generated by the Picker API, there is very little effort in adding the Picker to an existing site. This article will show how to use the picker for your application, and discuss some of the configuration options.

First create a view on the data describing the type of Picker that we will be using. In this case, we’ll use google.picker.ViewId.DOCS. For more types of Picker, see the documentation.


 
var view = new google.picker.View(google.picker.ViewId.DOCS);
 

You can set the MIME types to filter the list of files. This allows you to specify your application’s specific file types to display to the user.


 
view.setMimeTypes("text/plain,text/html");
 

Use a PickerBuilder to set the required configuration parameters for your Picker.


 
var picker = new google.picker.PickerBuilder()
.enableFeature(google.picker.Feature.NAV_HIDDEN)
.setAppId("your app id")
.addView(view)
.setTitle("Select a Text File")
.setCallback(pickerCallback).build();
 

Once configured, the picker can be popped up to the user as often as you like, using


 
picker.setVisible(true)
 

When a user selects a file with the Picker, the callback set in setCallback is called with the data from the dialog. Pass this callback as the action to perform when a user selects a file in the Picker.


 
function pickerCallback(data) {
if (data.action == google.picker.Action.PICKED) {
var fileId = data.docs[0].id;
alert(The user selected: + fileId);
}
}
 

Check the data’s action, in this case google.picker.action.PICKED, and if it is appropriate, access the file ID as the the first element of the docs attribute.

Here are some additional tips on customizing your Picker.

  • You can allow the user to select multiple files. There will be more than one element in the data’s docs array, each representing a selected file.

     
    var picker = new google.picker.PickerBuilder()
    .enableFeature(google.picker.Feature.MULTISELECT_ENABLED)
     
  • You can hide the navigation bar.

     
    var picker = new google.picker.PickerBuilder()
    .enableFeature(google.picker.Feature.NAV_HIDDEN)
     

For a complete example, including how to load the Picker library, please visit our the Drive SDK documentation. Also, see the Picker API documentation for more information.



Ali Afshar profile | twitter

Ali is a Developer Programs engineer at Google, working on Google Docs and the Shopping APIs which help shopping-based applications upload and search shopping content. As an eternal open source advocate, he contributes to a number of open source applications, and is the author of the PIDA Python IDE. Once an intensive care physician, he has a special interest in all aspects of technology for healthcare.

Read more »

Thursday, February 26, 2015

How to Organize Your Files for the Week!


If you liked last weeks post about organizing your life with technology, youll love this weeks post as well!  The winner of this weeks poll is how to organize your files for the week, using technology of course!


Heres the poll:


Before I go into organizing your files for the week, Im going to talk briefly about organizing your files digitally.  I know its a wordy tutorial but I promise I have lots of good tips included!!!


Now for the tutorial... you definitely need to download Dropbox if you dont already use it! If you already use it, keep reading anyway because I have some little trick you still might enjoy!





You can download this tutorial as a PDF by clicking this picture!
Note: This tutorial is hosted on Google Drive.  To save it from there, just open the file and click File > Download to save onto your computer!

The next Technology Tuesday post wont be until August 6... because Ill be vacationing with my hubby in Alaska celebrating our TEN YEAR anniversary (technically two years married, but 10 years since we started dating). How crazy is that? 


Now, as for the poll... Ill be adding how to give any picture a moving/talking mouth!



Read more »

Sunday, January 25, 2015

How to Compress Large Files to Small size





Asalam-o-Alaikum Friends!!!

Dosto ap sub kase hain Umeed Kerta hou ap sub Teek Taak honge,, Dosto Chalte hai  apne Tutorial ki taraf, Aj mai ap ko is Tutorial k zarye btao ga k Big File ko Winrar k zarye kase Highly Compressed kia jata hain. Highly Compressed karne se pehle ap apne PC pr jitne Program Run hai wo sub closed kar dain or System ko bilkul Free kar de  Pir Winrar open kare Task Manager main jakar is ki Property Real Time ker de es k leye ap k pass Winrar Full Version hona zarori ha, Trail bhi Work kerta But kabi kabi Teek se Compress nahi kerta os k bd Task Manager ko close kerde or Winrar ko Open rehne de. os k bd Screen shot Follow kare baki tarika Screen Shot k zarye bta dia hai.

I hope ap logo ko ye Tutorial Passand aye ga.
 

 
 

 

 
 



Read more »

Wednesday, January 21, 2015

Android beginner tutorial Part 93 XML animation files

In this tutorial well learn about the structure of XML files that are used for defining animations in Android.

The XML files for animation are put into the res/anim/ directory of the Android project. The file has to have a single root node, which can be either of the possible elements: , , , or .

The node can act as a container for all of the elements, including other elements.

Even though the elements are put in a sequence, the animations play at the same time. But you can use the startOffset property to set delay before each animation start.

There are attributes that can be applied to all the listed elements, as well as attributes that can only be applied to a specific type of animation element.

First, lets take a look at the global ones - duration, startOffset, fillBefore, fillAfter, repeatCount, repeatMode, zAdjustment, interpolator.

The duration value is basically the duration time of the animation in milliseconds.

The startOffset value is the time delay before the animation starts.

The fillBefore is a boolean value, which, if set to true, makes sure that the animation transformation is applied before the beginning of the animation (during the startOffset period).

The fillAfter is a boolean value, which, if set to true, makes sure that the animation transformation is applied after the animation ends.

The repeatCount value determines how many times the animation repeats.

The repeatMode can be set to "restart" or "reverse" to make the animation start over or play in reverse when it ends.

The zAdjustment value sets the adjustment of the Z ordering (depth) of the content. Can be set to "normal" to be treated normally and kept in its current Z order, to "top" to put it on top of everything else and "bottom" to put it behind everything else.

The interpolator value holds a reference to an interpolator, which is an animation modifier that can affect the rate of change in your animation. There is a number of pre-defined interpolators that you can use, or you can create custom ones. Example: @android:anim/accelerate_interpolator.

Now lets take a look at the exclusive attributes.

The set container supports a shareInterpolator attribute, which can be used for setting one interpolator for use by all the children of the set.

The alpha element has 2 attributes - fromAlpha and toAlpha, which determine the initial and destination alpha values for the object. Values range from 0 to 1.

The scale element is used for scaling objects. It has 6 new attributes - fromXScale, toXScale, fromYScale, toYScale, pivotX and pivotY. The first four simply determine the initial and destination scaling values on both axes. The pivotX and pivotY determine the coordinates of the anchor position, relative to which the scaling will ocur. This is similar to registration point in DisplayObjects in Flash.

The translate element lets us move an object across the screen. Possible new attributes are fromXDelta, toXDelta, fromYDelta and toYDelta. Possible values can be in 3 formats - an absolute numeric value, a relative value in percentages (from -100% to 100%) and value in percentages relative to the size of the objects parent (-100%p to 100%p).

The rotate element is used for rotating objects and has 4 attributes - fromDegrees, toDegrees, pivotX, pivotY. The first two determine the initial and destination rotation degrees, the second pair detemine the coordinates of the anchor.

Thats all for today.

Thanks for reading!
Read more »