2.camera 可setPreviewSize 設定秀在螢幕上的size, setPictureSize 設定儲存照片的size,
但是這個size不能隨便亂設,必須由getSupportedPreviewSizes/getSupportedPictureSizes從中挑一組出來
private boolean checkLineInstalled(){PackageManager pm = getPackageManager();m_appList = pm.getInstalledApplications(0);boolean lineInstallFlag = false;for (ApplicationInfo ai : m_appList) {if(ai.packageName.equals(PACKAGE_NAME)){lineInstallFlag = true;break;}}return lineInstallFlag;}
public static final String PACKAGE_NAME = "jp.naver.line.android";public static final String CLASS_NAME = "jp.naver.line.android.activity.selectchat.SelectChatActivity";
Intent intent = new Intent(Intent.ACTION_SEND);intent.setClassName(PACKAGE_NAME, CLASS_NAME);intent.setType("text/plain");intent.putExtra(Intent.EXTRA_TEXT, sendText);startActivity(intent);
String fname = "send_image.jpg";String fileFullPath = Environment.getExternalStorageDirectory().getAbsolutePath()+ File.separator + fname;
Uri uri = Uri.fromFile(new File(fileFullPath));Intent intent = new Intent(Intent.ACTION_SEND);intent.setClassName(PACKAGE_NAME, CLASS_NAME);intent.setType("image/jpeg");intent.putExtra(Intent.EXTRA_STREAM, uri);startActivity(intent);
public interface DemoInterface
{
final int x=0;
void a();
void b();
void c();
}
public abstract DemoAbstract
{
int y;
void a(){...};
abstract void b();
abstract void c();
}
Request request = new Request(Session.getActiveSession(), "me/feed", postParams, HttpMethod.POST, new Request.Callback(){...});
RequestAsyncTask task = new RequestAsyncTask(request);
task.execute();這裡的postParams 是 Bundle postParams = new Bundle();
link | The link attached to this post (點選name或圖片會跳過去link) |
picture | The URL of a picture attached to this post. The picture must be at least 50px by 50px (though minimum 200px by 200px is preferred) and have a maximum aspect ratio of 3:1 (圖片上的那塊藍綠圖) |
source | The URL of a media file (either SWF or MP3) attached to this post. If both source and picture are specified, only source is used. |
name | The name of the link attachment.(圖片上的Facebook Dialog) |
caption | The caption of the link (appears beneath the link name). If not specified, this field is automatically populated with the URL of the link.(圖片上的Reference Documentation) |
description | The description of the link (appears beneath the link caption). If not specified, this field is automatically populated by information scraped from the link, typically the title of the page. (圖片上的Using Dialogs to interact with users) |
properties | A JSON object of key/value pairs which will appear in the stream attachment beneath the description, with each property on its own line. Keys must be strings, and values can be either strings or JSON objects with the keys text and href .(會接在圖片上description後面) |
actions | A JSON array containing a single object describing the action link which will appear next to the "Comment" and "Like" link under posts. The contained object must have the keys name and link ."{'name'='text', 'link'='URL'}" (會在圖片上like, comment的右邊然後文字為text,連結為URL) |
final List<String> PERMISSIONS_PUBLISH = Arrays.asList("publish_actions", "publish_checkins");
LoginButton authButton=(LoginButton)findViewById(R.id.authButton);authButton.setPublishPermissions(PERMISSIONS_PUBLISH);
Permission | Description |
---|---|
read_friendlists | 讓你可取得使用者的好友名單 |
read_insights | 讓你可取得使用者允許的可視資料, 應用程式, 網域(domains the user owns) |
read_mailbox | 讓你可取得使用者的收件匣資訊 |
read_requests | 讓你可取得使用者的好友所發出的請求 |
read_stream | 讓你可取得使用者塗鴉牆上的News feed, 甚至具備搜尋的能力 |
xmpp_login | Provides applications that integrate with Facebook Chat the ability to log in users. |
ads_management | Provides the ability to manage ads and call the Facebook Ads API on behalf of a user. |
create_event | Enables your application to create and modify events on the user's behalf |
manage_friendlists | 讓你的程式可以建立與編輯使用者朋友群組 |
manage_notifications | Enables your app to read notifications and mark them as read. Intended usage: This permission should be used to let users read and act on their notifications; it should not be used to for the purposes of modeling user behavior or data mining. Apps that misuse this permission may be banned from requesting it. |
user_online_presence | Provides access to the user's online/offline presence |
friends_online_presence | Provides access to the user's friend's online/offline presence |
publish_checkins | 讓你的程式可以打卡 |
publish_actions | Enables your app to post content, comments, and likes to a user's stream and to the streams of the user's friends. This requires extra permissions from a person using your app. However, please note that Facebook recommends a user-initiated sharing model. Please read the Platform Policies to ensure you understand how to properly use this permission. Note, you do not need to request the publish_stream permission in order to use the Feed Dialog, the Requests Dialog or the Send Dialog. |
rsvp_event | Enables your application to RSVP to events on the user's behalf |