[Android] android 파일 다운로드 후 hwp파일 열기!
다른 블로그들 참고하는데 안되다가 되는 블로그 발견!
file = File 클래스 변수임(안나와있는데 대충 File클래스 메소드를 사용하길래 해당 자료형의 변수로 선언했더니 잘됨.
참고로 파일에 해당하는 뷰어나 볼 수 있는 프로그램이 있어야됨.
Intent intent = new Intent();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setAction(android.content.Intent.ACTION_VIEW);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
if (file.getName().endsWith(".pdf")){
try{
pdf = "application/pdf"
jpg 등 = "image/*"
docx = "application/msword"
txt = "text"
pptx = "application/vnd.ms-powerpoint"
hwp = "application/haansofthwp"
mp3 = "audio/*"
mp4 = "video/*"
...
mineType 안헷갈리게 조심!
'프로그래밍 > Android' 카테고리의 다른 글
[Android] Android 기기 현재 해상도 가져오기 (0) | 2015.04.01 |
---|---|
[Android] WebView(웹뷰) 속성 (0) | 2015.03.26 |
[Android] XML 파일 생성 (0) | 2015.03.18 |
[Android] if 값 비교가 제대로 안되는 경우 ex: if(a == b) (0) | 2015.03.16 |
[Android] Android 기본탐색기가 없다!! (0) | 2015.01.23 |
[던파] 이계 연습쩔 받는데 별난사람 다있네..
프레이섭 vampire
시로코섭 미미는변태
인가..
서버가 제대로 기억 안나네..
이계 연습쩔 받는데 무큐쓰면서 적 무적기 다걸고, 애초에 연습쩔하는데 파티장이 가만히 서있으라는데 중간중간 무큐기로 적 무적걸어줌 ㅋㅋㅋ(무큐쓰면 무적판정있는애들)
그래놓고 뭐라했더니 다 알고있다네요 ㅋㅋ
알면서 쓰면 .. 일부로 방해한건가 ?
연습쩔 받는데 파티장이 가만히 있으라는데 무큐기 계속 쓰니까.. 파티장 짠해서 뭐라고 대신 말해줬더만 자기가 잘한줄 아나봄;; 에휴..
기억해놨다가 이런애들이랑은 두번다시 팟안해야지;;
지난번에 안그래도 공팟에서 암걸렸는데.. 쩔받는데 빡치네 ㅋㅋㅋ
저사람들 아녔으면 굳이 4분클도 아니였는데.. 쩔받는데 4분클 하게 해놓고 뭔 잘난줄아는 두명..
'게임하자! > 던파' 카테고리의 다른 글
[던파/카시야스] "Toyblock" << 이계 수금사기꾼 (0) | 2015.06.20 |
---|---|
[던파] 구이계 파티 말없이 강퇴시키네.. (디레지에서버 Flashpoint) (0) | 2015.05.17 |
[던파] 구이계 공략 (마도 + 홍염6셋 + 85제 유니크 8재련) (0) | 2015.04.26 |
[던파] 구이계 마도 연습쩔 (영상 오류 -> 수정) (0) | 2015.04.26 |
퍼즐던파 45층 이후 가는 방법 (0) | 2014.07.06 |
[Android] XML 파일 생성
File newxmlfile = new File(Environment.getExternalStorageDirectory()+"/new.xml");
try{
newxmlfile.createNewFile();
}catch(IOException e){
Log.e("IOException", "exception in createNewFile() method");
}
//we have to bind the new file with a FileOutputStream
FileOutputStream fileos = null;
try{
fileos = new FileOutputStream(newxmlfile);
}catch(FileNotFoundException e){
Log.e("FileNotFoundException", "can't create FileOutputStream");
}
//we create a XmlSerializer in order to write xml data
XmlSerializer serializer = Xml.newSerializer();
try {
//we set the FileOutputStream as output for the serializer, using UTF-8 encoding
serializer.setOutput(fileos, "UTF-8");
//Write <?xml declaration with encoding (if encoding not null) and standalone flag (if standalone not null)
serializer.startDocument(null, Boolean.valueOf(true));
//set indentation option
serializer.setFeature("http://xmlpull.org/v1/doc/features.html#indent-output", true);
//start a tag called "root"
serializer.startTag(null, "root");
//i indent code just to have a view similar to xml-tree
serializer.startTag(null, "child1");
serializer.endTag(null, "child1");
serializer.startTag(null, "child2");
//set an attribute called "attribute" with a "value" for
serializer.attribute(null, "attribute", "value");
serializer.endTag(null, "child2");
serializer.startTag(null, "child3");
//write some text inside
serializer.text("some text inside child3");
serializer.endTag(null, "child3");
serializer.endTag(null, "root");
serializer.endDocument();
//write xml data into the FileOutputStream
serializer.flush();
//finally we close the file stream
fileos.close();
} catch (Exception e) {
Log.e("Exception","error occurred while creating xml file");
}
출처 : http://www.shop-wiz.com/document/android/execise_linkage_web_xml_create
'프로그래밍 > Android' 카테고리의 다른 글
[Android] WebView(웹뷰) 속성 (0) | 2015.03.26 |
---|---|
[Android] android 파일 다운로드 후 hwp파일 열기! (0) | 2015.03.26 |
[Android] if 값 비교가 제대로 안되는 경우 ex: if(a == b) (0) | 2015.03.16 |
[Android] Android 기본탐색기가 없다!! (0) | 2015.01.23 |
I/Choreographer(5855): Skipped 99 frames! The application may be doing too much work on its main thread. (0) | 2015.01.22 |