Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3457388
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:51:14+00:00 2026-05-18T09:51:14+00:00

I just want get my video playUrl in android…. I have checked the relevant

  • 0

I just want get my video playUrl in android….
I have checked the relevant issues about use YouTubeSample in android ,Their answer is yes
But when i run my code in emulator or my android device it does not work
my code is:

    import java.io.IOException;
    import com.google.api.client.googleapis.GoogleHeaders;
    import com.google.api.client.googleapis.GoogleTransport;
    import com.google.api.client.googleapis.json.*;
    import com.google.api.client.http.*;
    import android.app.Activity;
    import android.os.Bundle;
    import android.widget.TextView;
    public class main extends Activity {
     HttpTransport transport;
        /** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);

            Debug.enableLogging();
            try {
              try {
                HttpTransport transport = setUpTransport();
                showVideos(transport);
              } catch (HttpResponseException e) {

                throw e;
              }
            } catch (Throwable t) {
              t.printStackTrace();

            }
        }
        private static HttpTransport setUpTransport() {
            HttpTransport transport = GoogleTransport.create();
            GoogleHeaders headers = (GoogleHeaders) transport.defaultHeaders;
            headers.setApplicationName("Google-YouTubeSample/1.0");
            headers.gdataVersion = "2";
            transport.addParser(new JsonCParser());
            return transport;
          }

          private static VideoFeed showVideos(HttpTransport transport)
              throws IOException {
            //View.header("Get Videos");
            // build URL for the video feed for "search stories"
            YouTubeUrl url = YouTubeUrl.forVideosFeed();
            url.author = "cecol3500123";
            // execute GData request for the feed
            VideoFeed feed = VideoFeed.executeGet(transport, url);
            //View.display(feed);
            return feed;
          }
    }

I compile it ok ,but on the device just get the application main has stopped unexpectedly

I found I always stopped on code:HttpTransport transport = GoogleTransport.create();

The AndroidManifest has set permission :
<uses-permission android:name="android.permission.INTERNET"></uses-permission>

And my project has google api java client library.
What I set, is it okay?
I have tried all possible(I had modified the code, again and again) .
I do not know how to do.
Please help me ,I just want get my video playUrl in android….
(Or can someone give me right code ? ) .
sorry for my poor English

renew with debug trace
this is my program Debug trace                             
11-23 09:45:10.466: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f0700e5                                 
11-23 09:45:10.486: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f020031        
11-23 09:45:10.496: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f020030        
11-23 09:45:10.506: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f050000       
11-23 09:45:10.716: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f060000            
11-23 09:45:10.856: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f060001                       
11-23 09:45:11.866: DEBUG/ddm-heap(180): Got feature list request    
11-23 09:45:12.166: DEBUG/ddm-heap(185): Got feature list request                
11-23 09:45:12.526: DEBUG/ddm-heap(165): Got feature list request               
11-23 09:45:12.716: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f0700e5                             
11-23 09:45:12.756: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f020031                                
11-23 09:45:12.767: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f020030                           
11-23 09:45:12.776: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f050000                       
11-23 09:45:12.796: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f060000                        
11-23 09:45:12.826: WARN/ResourceType(62): Resources don't contain package for resource number 0x7f060001     
11-23 09:45:13.286: DEBUG/ddm-heap(143): Got feature list request    
11-23 09:45:13.646: WARN/BackupManagerService(62): dataChanged but no participant pkg='com.android.providers.settings' uid=10017      
11-23 09:45:13.946: WARN/BackupManagerService(62): dataChanged but no participant pkg='com.android.providers.settings' uid=10017    
11-23 09:45:14.426: DEBUG/dalvikvm(62): GC freed 8344 objects / 558776 bytes in 461ms    
11-23 09:45:14.826: INFO/ActivityManager(62): Start proc com.android.email for broadcast     com.android.email/com.android.exchange.BootReceiver: pid=205 uid=10023 gids={3003, 1015}
11-23 09:45:14.836: INFO/ActivityManager(62): Starting activity: Intent {        act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.testcom/.main }        
11-23 09:45:15.066: DEBUG/AndroidRuntime(185): Shutting down VM          
11-23 09:45:15.076: DEBUG/dalvikvm(185): DestroyJavaVM waiting for non-daemon threads to exit           
11-23 09:45:15.106: DEBUG/dalvikvm(185): DestroyJavaVM shutting VM down    
11-23 09:45:15.106: DEBUG/dalvikvm(185): HeapWorker thread shutting down    
11-23 09:45:15.116: DEBUG/dalvikvm(185): HeapWorker thread has shut down     
11-23 09:45:15.127: DEBUG/jdwp(185): JDWP shutting down net...    
11-23 09:45:15.127: INFO/dalvikvm(185): Debugger has detached; object registry had 1 entries               
11-23 09:45:15.147: DEBUG/dalvikvm(185): VM cleaning up            
11-23 09:45:15.226: ERROR/AndroidRuntime(185): ERROR: thread attach failed         
11-23 09:45:15.496: DEBUG/dalvikvm(185): LinearAlloc 0x0 used 639500 of 5242880 (12%)          
11-23 09:45:15.566: WARN/ActivityManager(62): Activity pause timeout for     HistoryRecord{43cec138 com.android.launcher/.Launcher}     
11-23 09:45:15.676: INFO/ActivityManager(62): Start proc com.testcom for activity     com.testcom/.main: pid=210 uid=10027 gids={3003, 1015}   
11-23 09:45:16.266: DEBUG/ddm-heap(205): Got feature list request   
11-23 09:45:16.786: DEBUG/ddm-heap(210): Got feature list request   
11-23 09:45:16.976: DEBUG/dalvikvm(30): GC freed 284 objects / 10848 bytes in 1262ms   
11-23 09:45:17.517: DEBUG/dalvikvm(30): GC freed 50 objects / 2224 bytes in 410ms   
11-23 09:45:17.647: INFO/dalvikvm(210): Could not find method    com.google.api.client.googleapis.GoogleTransport.create, referenced from method com.testcom.main.setUpTransport     
11-23 09:45:17.657: WARN/dalvikvm(210): VFY: unable to resolve static method 4:     Lcom/google/api/client/googleapis/GoogleTransport;.create ()Lcom/google/api/client/http/HttpTransport;
11-23 09:45:17.657: DEBUG/dalvikvm(210): VFY: replacing opcode 0x71 at 0x0009    
11-23 09:45:17.677: DEBUG/dalvikvm(210): Making a copy of Lcom/testcom/main;.setUpTransport code (128 bytes)    
11-23 09:45:17.687: WARN/dalvikvm(210): VFY: unable to find class referenced in signature (Lcom/google/api/client/http/HttpTransport;)
11-23 09:45:17.697: WARN/dalvikvm(210): Unable to resolve superclass of Lcom/testcom/YouTubeUrl; (6)
11-23 09:45:17.777: WARN/dalvikvm(210): Link of class 'Lcom/testcom/YouTubeUrl;' failed   
11-23 09:45:17.777: INFO/dalvikvm(210): Could not find method     com.testcom.YouTubeUrl.forVideosFeed, referenced from method com.testcom.main.showVideos
11-23 09:45:17.787: WARN/dalvikvm(210): VFY: unable to resolve static method 40:     Lcom/testcom/YouTubeUrl;.forVideosFeed ()Lcom/testcom/YouTubeUrl;
11-23 09:45:17.787: DEBUG/dalvikvm(210): VFY: replacing opcode 0x71 at 0x0007    
11-23 09:45:17.826: DEBUG/dalvikvm(210): Making a copy of Lcom/testcom/main;.showVideos code (56 bytes)    
11-23 09:45:17.867: WARN/dalvikvm(210): VFY: unable to find class referenced in signature (Lcom/google/api/client/http/HttpTransport;)      
11-23 09:45:17.877: WARN/dalvikvm(210): VFY: unable to find class referenced in signature (Lcom/google/api/client/http/HttpTransport;)      
11-23 09:45:17.927: WARN/dalvikvm(210): VFY: unable to resolve exception class 13 (Lcom/google/api/client/http/HttpResponseException;)   
11-23 09:45:17.937: WARN/dalvikvm(210): VFY: unable to find exception handler at addr 0x13     
11-23 09:45:17.947: WARN/dalvikvm(210): VFY:  rejected Lcom/testcom/main;.onCreate (Landroid/os/Bundle;)V     
11-23 09:45:17.957: WARN/dalvikvm(210): VFY:  rejecting opcode 0x0d at 0x0013    
11-23 09:45:17.957: WARN/dalvikvm(210): VFY:  rejected Lcom/testcom/main;.onCreate     (Landroid/os/Bundle;)V
11-23 09:45:18.017: WARN/dalvikvm(210): Verifier rejected class Lcom/testcom/main;    
11-23 09:45:18.017: WARN/dalvikvm(210): Class init failed in newInstance call     (Lcom/testcom/main;)
11-23 09:45:18.027: DEBUG/AndroidRuntime(210): Shutting down VM     
11-23 09:45:18.037: WARN/dalvikvm(210): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
11-23 09:45:18.047: ERROR/AndroidRuntime(210): Uncaught handler: thread main exiting due to uncaught exception     
11-23 09:45:18.107: DEBUG/dalvikvm(30): GC freed 2 objects / 48 bytes in 568ms    
11-23 09:45:18.167: ERROR/AndroidRuntime(210): java.lang.VerifyError: com.testcom.main    
11-23 09:45:18.167: ERROR/AndroidRuntime(210):     at    java.lang.Class.newInstanceImpl(Native Method)    
11-23 09:45:18.167: ERROR/AndroidRuntime(210):     at java.lang.Class.newInstance(Class.java:1479)    
11-23 09:45:18.167: ERROR/AndroidRuntime(210):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)    
11-23 09:45:18.167: ERROR/AndroidRuntime(210):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409)    
11-23 09:45:18.167: ERROR/AndroidRuntime(210):     at  android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)    
11-23 09:45:18.167: ERROR/AndroidRuntime(210):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)   
11-23 09:45:18.167: ERROR/AndroidRuntime(210):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)   
11-23 09:45:18.167: ERROR/AndroidRuntime(210):     at android.os.Handler.dispatchMessage(Handler.java:99)    
11-23 09:45:18.167: ERROR/AndroidRuntime(210):     at android.os.Looper.loop(Looper.java:123)    
11-23 09:45:18.167: ERROR/AndroidRuntime(210):     at android.app.ActivityThread.main(ActivityThread.java:4363)    
11-23 09:45:18.167: ERROR/AndroidRuntime(210):     at java.lang.reflect.Method.invokeNative(Native Method)    
11-23 09:45:18.167: ERROR/AndroidRuntime(210):     at java.lang.reflect.Method.invoke(Method.java:521)       
11-23 09:45:18.167: ERROR/AndroidRuntime(210):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)    
11-23 09:45:18.167: ERROR/AndroidRuntime(210):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)    
11-23 09:45:18.167: ERROR/AndroidRuntime(210):     at dalvik.system.NativeStart.main(Native Method)    
11-23 09:45:18.237: INFO/ActivityThread(205): Publishing provider    com.android.email.provider: com.android.email.provider.EmailProvider   
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T09:51:15+00:00Added an answer on May 18, 2026 at 9:51 am

    Hey ,everybody(just only two people)
    I have found the problem is my library path is not right
    The compile classpath is right but the runtime classpath is wrong in eclipse
    Although I do not know how the case
    My solution is add .jar file under the project directly instead of creating an user library(which includes .jar file) and add it to project
    So,the youtubesample can run on android but you need to pay attention to classpath settings

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I didn't find it on their doc http://www.sqlite.org/lang_corefunc.html So just want to get confirm
From my web page,i just want to browse a video file and then get
I just want to get some thoughts on storing variables for JQuery's use. Example
I just want get a 2 dimension array of List in c#. In my
I just want to get a selector name, and the arguments, sender, or an
I just want to get a quick htaccess redirection. ie: domain.com/subfolderGreen --> domain.com/index.php?folder=subfolderGreen (note
I just want to get the System IP address and display it on a
I just want to get numbers of times to be used for each Activity.
I just want to get email id of user having phone number given. so
I just want to get the total days in a list of dates. Here

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.