비주얼 스튜디오 유니코드로 저장하기

.editorconfig로 파일명으로 프로젝트 폴더 안에 저장한다. root = true [*] charset = utf-8 다음과 같이 저장한다.
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(android.net.Uri.parse("http://url"))
startActivity(intent);
Intent intent = new Intent();
intent.setAction(android.content.Intent.ACTION_VIEW);
File file = new File("/sdcard/test.mp4");
intent.setDataAndType(Uri.fromFile(file), "video/*");
startActivity(intent);
Intent intent = new Intent();
intent.setAction(android.content.Intent.ACTION_VIEW);
File file = new File("/sdcard/test.mp3");
intent.setDataAndType(Uri.fromFile(file), "audio/*");
startActivity(intent);
Intent intent = new Intent(Intent.ACTION_VIEW);
File file = new File(filePath);
intent.setDataAndType(Uri.fromFile(file), "*/*");//
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
public class APKInstall extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
File apkFile = new File("/sdcard/FileBrowser.apk");
Uri apkUri = Uri.fromFile(apkFile);
Log.i("APKInstall", "Set apk path");
try {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType( Uri.fromFile(apkFile), "application/vnd.android.package-archive");
startActivity(intent);
Log.i("APKInstall", "APK installed");
} catch (Exception e) {
// TODO: handle exception
Log.i("APKInstall", e.getMessage());
}
// PackageManager pm = getPackageManager();
// pm.installPackage(apkUri);
}
}
packages/apps/PackageInstaller/src/com/android/packageinstaller/InstallAppProgress.java
if((installFlags & PackageManager.REPLACE_EXISTING_PACKAGE )!= 0) {
Log.w(TAG, "Replacing package:"+mAppInfo.packageName);
}
PackageInstallObserver observer = new PackageInstallObserver();
pm.installPackage(mPackageURI, observer, installFlags);
File apkFile = new File("/sdcard/ApkTest.apk");
Uri apkUri = Uri.fromFile(apkFile);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType( Uri.fromFile(apkFile), "application/vnd.android.package-archive");
startActivity(intent);
Intent intent = new Intent ();
intent.setAction (Intent.ACT ION_WEB_SEARCH);
intent.putExtra (SearchManager.QUERY, "searchString")
startActivity (intent);
Uri uri = Uri.parse ( "http://www.google.com");
Intent it = new Intent (Intent.ACT ION_VIEW, uri);
startActivity (it);
Uri uri = Uri.parse ( "geo: 38.899533, -77.036476");
Intent it = new Intent (Intent.Act ion_VIEW, uri);
startActivity (it);
Uri uri = Uri.parse ( "http://maps.google.com/maps?f=dsaddr=startLat% 20startLng & daddr = endLat% 20endLng & hl = en");
Intent it = new Intent (Intent.ACT ION_VIEW, URI);
startActivity (it);
Uri uri = Uri.parse ( "tel: xxxxxx");
Intent it = new Intent (Intent.ACT ION_DIAL, uri);
startActivity (it);
Intent it = new Intent (Intent.ACT ION_VIEW);
it.putExtra ( "sms_body", "The SMS text");
it.setType ( "vnd.android-dir/mms-sms");
startActivity (it);
Uri uri = Uri.parse ( "smsto: 0800000123");
Intent it = new Intent (Intent.ACT ION_SENDTO, uri);
it.putExtra ( "sms_body", "The SMS text");
startActivity (it);
String body = "this is sms demo";
Intent mmsintent = new Intent (Intent.ACT ION_SENDTO, Uri.fromParts ( "smsto", number, null));
mmsintent.putExtra (Messaging.KEY_ACT ION_SENDTO_MESSAGE_BODY, body);
mmsintent.putExtra (Messaging.KEY_ACT ION_SENDTO_COMPOSE_MODE, true);
mmsintent.putExtra (Messaging.KEY_ACT ION_SENDTO_EXIT_ON_SENT, true);
startActivity (mmsintent);
Uri uri = Uri.parse ( "content: / / media/external/images/media/23");
Intent it = new Intent (Intent.ACTION_SEND);
it.putExtra ( "sms_body", "some text");
it.putExtra (Intent.EXTRA_STREAM, uri);
it.setType ( "image / png");
startActivity (it);
// 2nd ????
StringBuilder sb = new StringBuilder ();
sb.append ( "file ://");
sb.append (fd.getAbsoluteFile ());
Intent intent = new Intent (Intent.ACT ION_SENDTO, Uri.fromParts ( "mmsto", number, null));
/ / Below extra datas are all optional.
intent.putExtra (Messaging.KEY_ACT ION_SENDTO_MESSAGE_SUBJECT, subject);
intent.putExtra (Messaging.KEY_ACT ION_SENDTO_MESSAGE_BODY, body);
intent.putExtra (Messaging.KEY_ACT ION_SENDTO_CONTENT_URI, sb.toString ());
intent.putExtra (Messaging.KEY_ACT ION_SENDTO_COMPOSE_MODE, composeMode);
intent.putExtra (Messaging.KEY_ACT ION_SENDTO_EXIT_ON_SENT, exitOnSent);
startActivity (intent);
Uri mmsUri = Uri.parse("mmsto:");
Intent sendIntent = new Intent(Intent.ACTION_VIEW, mmsUri );
sendIntent.addCategory("android.intent.category.DEFAULT");
sendIntent.addCategory("android.intent.category.BROWSABLE");
sendIntent.putExtra("address", destinationAddress);
sendIntent.putExtra("exit_on_sent", true);
sendIntent.putExtra("subject", subject);
sendIntent.putExtra("sms_body", body);
Uri dataUri = Uri.parse("content://media/external/images/media/1");
sendIntent.putExtra(Intent.EXTRA_STREAM, dataUri);
getContext().startActivity(sendIntent);
Uri uri = Uri.parse ( "mailto: xxx@abc.com");
Intent it = new Intent (Intent.ACT ION_SENDTO, uri);
startActivity (it);
Intent it = new Intent (Intent.ACT ION_SEND);
it.putExtra (Intent.EXTRA_EMAIL, "me@abc.com"); //????
it.putExtra (Intent.EXTRA_TEXT, "The email body text");
it.setType ( "text / plain");
startActivity (Intent.createChooser (it, "Choose Email Client"));
String[] mailto = { "a@a.com" };
sendIntent.putExtra(Intent.EXTRA_EMAIL, mailto); // <- 맞음
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_SUBJECT, "subject");
sendIntent.setType("text/csv");
sendIntent.putExtra(Intent.EXTRA_EMAIL, "test@gmail.com"); //??????
sendIntent.putExtra(Intent.EXTRA_TEXT, body);
act.startActivity(Intent.createChooser(sendIntent, "Send email"));
Intent it = new Intent (Intent.ACT ION_SEND);
String [] tos = ( "me@abc.com");
String [] ccs = ( "you@abc.com");
it.putExtra (Intent.EXTRA_EMAIL, tos);
it.putExtra (Intent.EXTRA_CC, ccs);
it.putExtra (Intent.EXTRA_TEXT, "The email body text");
it.putExtra (Intent.EXTRA_SUBJECT, "The email subject text");
it.setType ( "message/rfc822");
startActivity (Intent.createChooser (it, "Choose Email Client"));
Intent it = new Intent (Intent.ACT ION_SEND);
it.putExtra (Intent.EXTRA_SUBJECT, "The email subject text");
it.putExtra (Intent.EXTRA_STREAM, "file: / / / sdcard/mysong.mp3");
sendIntent.setType ( "audio/mp3");
startActivity (Intent.createChooser (it, "Choose Email Client"));
Intent it = new Intent (Intent.ACT ION_VIEW);
Uri uri = Uri.parse ( "file: / / / sdcard/song.mp3");
it.setDataAndType (uri, "audio/mp3");
startActivity (it);
Uri uri = Uri.withAppendedPath (MediaStore.Audio.Media.INTERNAL_CONTENT_URI, "1");
Intent it = new Intent (Intent.ACT ION_VIEW, uri);
startActivity (it);
Uri uri = Uri.fromParts ( "package", strPackageName, null);
Intent it = new Intent (Intent.ACT ION_DELETE, uri);
startActivity (it);
Uri installUri = Uri.fromParts ( "package", "xxx", null);
returnIt = new Intent (Intent.ACT ION_PACKAGE_ADDED, installUri);
private void sendEmail(String[] address, String subject, String msg) {
Intent send = new Intent(Intent.ACTION_SEND);
send.putExtra(Intent.EXTRA_EMAIL, address);
send.putExtra(Intent.EXTRA_SUBJECT, subject);
send.putExtra(Intent.EXTRA_TEXT, msg);
send.setType("text/plain");
startActivity(Intent.createChooser(send, "MySendMail"));
}
Intent msg=new Intent(Intent.ACTION_SEND);
msg.putExtra(Intent.EXTRA_EMAIL ,"testto@test.net");
msg.putExtra(Intent.EXTRA_SUBJECT, "Here is the subject for the email");
//this next line adds an attachment, but I'm having some issues with the file location
msg.putExtra(Intent.EXTRA_STREAM, Uri.parse ("file://" + Environment.getExternalStorageDirectory() + "test.txt"));
msg.putExtra(Intent.EXTRA_BCC, "testbcc@test.net");
msg.putExtra(Intent.EXTRA_CC, "testcc@test.net");
//This next line puts in the body of the message
msg.putExtra(Intent.EXTRA_TEXT,"Attached is your file ");
msg.setType("text/csv");
//Another type to try
//msg.setType("message/rfc822");
startActivity(Intent.createChooser(msg, "Send Email"));
댓글
댓글 쓰기