This problem may look similar but in no way related to "video sharing on Facebook using Facebook sdk" or "sharing plain text or image using the share intent" . I have followed these posts on SO ->
Android share intent for Facebook
如何通过在Facebook上的共享意向与CAPTION分享照片?
外部联系
http://sudarmuthu.com/blog/sharing-content-in-android-using-action_send-intent
and came to know about the share intent in android which can be launched to share the images/videos/text with the existing sharing application on Android Phone. I used this code to share the image on facebook :
package com.mypackage.share;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
public class FbshareActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Intent share = new Intent(Intent.ACTION_SEND);
share.setType("image/jpg");
share.putExtra(Intent.EXTRA_STREAM,Uri.parse("file:///mnt/sdcard/tutu.jpg"));
startActivity(Intent.createChooser(share, "Share Image"));
}
}
The Manifest file is as below:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mypackage.share"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:label="@string/app_name"
android:name=".FbshareActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
罚款。 我能够分享面对面的形象。
Now I want to upload the video : I replaced this line : share.setType("image/jpg");
with this
share.setType("video/3gpp");
and this one
share.putExtra(Intent.EXTRA_STREAM,Uri.parse("**file:///mnt/sdcard/dimg1333456357958.jpg"));**
with this one
share.putExtra(Intent.EXTRA_STREAM,Uri.parse("**file:///mnt/sdcard/a123bghy4.3gpp"));**
但是,我正在把这一错误带上法典:
/Environment(30996): getExternalStorageState/mnt/sdcard
E/Environment(30996): getExternalStorageList
W/MountService( 2879): getVolumeState(/mnt/sdcard/external_sd): Unknown volume
W/MountService( 2879): getVolumeState(/mnt/sdcard/external_sd): Unknown volume
E/Environment(30996): getExternalStorageState/mnt/sdcard
D/SurfaceFlinger( 2879): [JJ]removeSurface for sid=74
D/dalvikvm(30996): GC_CONCURRENT freed 1106K, 19% free 8612K/10503K, paused 3ms+5ms
E/SurfaceFlinger( 2879): [JJ]SurfaceFlinger FPS: 24.994677
D/ACRA (30996): Writing crash report file.
D/ACRA (30996): Mark all pending reports as approved.
D/ACRA (30996): Looking for error files in /data/data/com.facebook.katana/app_acra-reports
V/ACRA (30996): About to start ReportSenderWorker from #handleException
D/ACRA (30996): Add user comment to null
D/ACRA (30996): #checkAndSendReports - start
D/ACRA (30996): Looking for error files in /data/data/com.facebook.katana/app_acra-reports
I/ACRA (30996): Sending file 1333628258000-approved.stacktrace
D/ACRA (30996): Connect to https://www.facebook.com/mobile/android_crash_logs/
D/ACRA (30996): Setting httpPost headers
D/ACRA (30996): Sending request to https://www.facebook.com/mobile/android_crash_logs/
D/dalvikvm(30996): GC_CONCURRENT freed 631K, 18% free 8644K/10503K, paused 5ms+2ms
W/ResponseProcessCookies(30996): Invalid cookie header: "Set-Cookie: datr=ZY19T4_v6CV68jQn4FTduX_l; expires=Sat, 05-Apr-2014 12:17:41 GMT; path=/; domain=.facebook.com; httponly". Unable to parse expires attribute: Sat
E/SurfaceFlinger( 2879): [JJ]SurfaceFlinger FPS: 4.741684
D/BatteryService( 2879): update start
D/ACRA (30996): #checkAndSendReports - finish
E/AndroidRuntime(30996): FATAL EXCEPTION: main
E/AndroidRuntime(30996): java.lang.NullPointerException
E/AndroidRuntime(30996): at com.facebook.katana.service.method.VideoUpload.getRealPathFromURI(VideoUpload.java:144)
E/AndroidRuntime(30996): at com.facebook.katana.service.method.VideoUpload.start(VideoUpload.java:165)
E/AndroidRuntime(30996): at com.facebook.katana.binding.AppSession.postToService(AppSession.java:4212)
E/AndroidRuntime(30996): at com.facebook.katana.service.method.VideoUpload.RequestVideoUpload(VideoUpload.java:73)
E/AndroidRuntime(30996): at com.facebook.katana.activity.media.UploadVideoActivity.upload(UploadVideoActivity.java:209)
E/AndroidRuntime(30996): at com.facebook.katana.activity.media.UploadVideoActivity.onClick(UploadVideoActivity.java:169)
E/AndroidRuntime(30996): at android.view.View.performClick(View.java:3100)
E/AndroidRuntime(30996): at android.view.View$PerformClick.run(View.java:11644)
E/AndroidRuntime(30996): at android.os.Handler.handleCallback(Handler.java:587)
E/AndroidRuntime(30996): at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime(30996): at android.os.Looper.loop(Looper.java:126)
E/AndroidRuntime(30996): at android.app.ActivityThread.main(ActivityThread.java:4002)
E/AndroidRuntime(30996): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(30996): at java.lang.reflect.Method.invoke(Method.java:491)
E/AndroidRuntime(30996): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)
E/AndroidRuntime(30996): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
E/AndroidRuntime(30996): at dalvik.system.NativeStart.main(Native Method)
D/SurfaceFlinger( 2879): screenshot: sw=216, sh=135, minZ=0, maxZ=21015
W/ActivityManager( 2879): Force finishing activity com.facebook.katana/.activity.media.UploadVideoActivity
D/SurfaceFlinger( 2879): screenshot: result = OK
E/android.os.Debug( 2879): Dumpstate > /data/log/dumpstate_app_com_facebook_katana_error
I/dumpstate(31581): begin
W/ActivityManager( 2879): Activity pause timeout for ActivityRecord{40f51e68 com.facebook.katana/.activity.media.UploadVideoActivity}
F//system/bin/logcat(31586): stack corruption detected: aborted
W/PowerManagerService( 2879): Timer 0x3->0x3|0x0
D/VoldCmdListener( 87): asec list
I/dumpstate(31581): done
D/InputTransport( 2879): channel 41014710 Sorry! - Use *#9900# to take log - (server) ~ mPointerStates->semaphore initialized 0x586ac000.
D/InputTransport( 2879): channel 41014710 Sorry! - Use *#9900# to take log - (server) ~ mPointerStates initialized 0x586ac000.
D/InputTransport( 2879): channel 41014710 Sorry! - Use *#9900# to take log - (client) ~ mPointerStates initialized 0x587f1000.
E/SurfaceFlinger( 2879): [JJ]SurfaceFlinger FPS: 0.207880
D/SurfaceFlinger( 2879): [JJ]createSurface for pid 31559 (1280 x 752)
D/SurfaceFlinger( 2879): [JJ]createSurface for pid 2879 (1 x 1)
E/SurfaceFlinger( 2879): [JJ]SurfaceFlinger FPS: 18.909105
how can i debug the com.facebook.katana ? Plz assit. Rgds