31 |
ImageView imageView; |
ImageView imageView; |
32 |
Spinner folderSpinner; |
Spinner folderSpinner; |
33 |
|
|
34 |
|
EditText edtTitle; |
35 |
|
EditText edtText; |
36 |
|
|
37 |
@Override |
@Override |
38 |
protected void onCreate(Bundle savedInstanceState) { |
protected void onCreate(Bundle savedInstanceState) { |
48 |
|
|
49 |
Log.i("CADDI", "Orientation:" + orientation); |
Log.i("CADDI", "Orientation:" + orientation); |
50 |
|
|
51 |
|
edtTitle = (EditText) findView( R.id.edtTitle); |
52 |
|
edtText = (EditText) findView( R.id.edtText); |
53 |
|
|
54 |
|
|
55 |
folderSpinner = (Spinner) findViewById(R.id.folderSpinner); |
folderSpinner = (Spinner) findViewById(R.id.folderSpinner); |
56 |
folderSpinner.setPrompt("Billedmappe"); |
folderSpinner.setPrompt("Billedmappe"); |
75 |
ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
76 |
bm.compress(Bitmap.CompressFormat.JPEG, 90, baos); |
bm.compress(Bitmap.CompressFormat.JPEG, 90, baos); |
77 |
|
|
78 |
|
String title = edtTitle.getText().toString(); |
79 |
|
String text = edtText.getText().toString(); |
80 |
|
|
81 |
|
String folder = (String) spinner.getSelectedItem(); |
82 |
|
|
83 |
|
if (title.trim().equals("") { |
84 |
|
Toast.makeText(CompletePictureActivity.this, "Titel skal angives", Toast.LENGTH_LONG).show(); |
85 |
|
return; |
86 |
|
} |
87 |
|
|
88 |
//DEBUG |
//DEBUG |
89 |
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); |
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); |
91 |
|
|
92 |
|
|
93 |
try { |
try { |
94 |
WebserviceWrapper.uploadFile("Test", "test", "test", baos.toByteArray()); |
|
95 |
|
|
96 |
|
WebserviceWrapper.uploadFile("Test", title, text, baos.toByteArray()); |
97 |
Toast.makeText(CompletePictureActivity.this, "Upload OK", Toast.LENGTH_LONG).show(); |
Toast.makeText(CompletePictureActivity.this, "Upload OK", Toast.LENGTH_LONG).show(); |
98 |
|
|
99 |
} catch (Exception e) { |
} catch (Exception e) { |