이 블로그 게시물은 단지 그것에 대해 말하는 것 같습니다.
Post JSON Using Android And HttpClient
편집 : 귀하의 회신을 보았다. 방법은 다음과 같습니다. 이 보내려면이 후 기본적으로
public static void main(String[] args) {
File file = new File("<path to json file>");
FileInputStream fis;
String json = "";
try {
fis = new FileInputStream(file);
BufferedInputStream bis = new BufferedInputStream(fis);
DataInputStream dis = new DataInputStream(bis);
// dis.available() returns 0 if the file does not have more lines.
while (dis.available() != 0) {
json += dis.readLine();
}
// dispose all the resources after using them.
fis.close();
bis.close();
dis.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
당신이 문자열 개체를 만들 것입니다 :) 트릭 않습니다 희망
StringEntity st = new StringEntity(json.toString());
그럼 그냥 링크의 단계를 수행
하하, 당신의 2 차 편집 질문 : 데이터베이스의 텍스트로 문자열을 만드십시오. 그게 전부입니다. 그런 다음 위와 같은 StringEntity를 만듭니다.
thx for link, 나는 그것을 보았습니다. n json creation에 관한 문제가 발생했습니다. 어떻게 만들 수 있습니까? 나는 삐죽 삐죽해야합니까? – sayvortana
thx manish burman ur 편집 된 답변, 미안 지금은 그냥 내 질문을 편집 할 수 있습니다. – sayvortana