remove non-essential stuff from example App1
This commit is contained in:
parent
f1f3fd75a2
commit
08e98e7c26
6 changed files with 0 additions and 259 deletions
|
@ -8,49 +8,13 @@ import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.net.HttpURLConnection;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.lang.Thread;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import android.text.method.ScrollingMovementMethod;
|
import android.text.method.ScrollingMovementMethod;
|
||||||
|
|
||||||
class Threads1 implements Runnable {
|
|
||||||
|
|
||||||
public String result = "alex";
|
|
||||||
|
|
||||||
public void run(){
|
|
||||||
try{
|
|
||||||
result = result.concat("step 2\n");
|
|
||||||
result = result.concat("SUPER\n");
|
|
||||||
//URL url = new URL("https://alexmahr.de/word");
|
|
||||||
//result = result.concat("step 3\n");
|
|
||||||
//HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
|
|
||||||
//result = result.concat("step 4\n");
|
|
||||||
//BufferedReader in = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
|
|
||||||
//result = result.concat("step 5\n");
|
|
||||||
//String inputLine;
|
|
||||||
//StringBuffer response = new StringBuffer();
|
|
||||||
//result = result.concat("step 6\n");
|
|
||||||
|
|
||||||
//while ((inputLine = in.readLine()) != null) {
|
|
||||||
//result = result.concat("step 7\n");
|
|
||||||
//response.append(inputLine);
|
|
||||||
//}
|
|
||||||
//result = result.concat("step 8\n");
|
|
||||||
//in.close();
|
|
||||||
//result = result.concat("step 9\n");
|
|
||||||
//result = result.concat( "OK".concat(response.toString()));
|
|
||||||
//urlConnection.disconnect();
|
|
||||||
} catch (Exception e){
|
|
||||||
// throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public class App1 extends Activity
|
public class App1 extends Activity
|
||||||
{
|
{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState)
|
public void onCreate(Bundle savedInstanceState)
|
||||||
{
|
{
|
||||||
|
@ -61,53 +25,8 @@ public class App1 extends Activity
|
||||||
String result = "initial";
|
String result = "initial";
|
||||||
TextView tv = new TextView(this);
|
TextView tv = new TextView(this);
|
||||||
tv.setMovementMethod(new ScrollingMovementMethod());
|
tv.setMovementMethod(new ScrollingMovementMethod());
|
||||||
Threads1 threads1 = new Threads1();
|
|
||||||
Thread thread = new Thread(threads1);
|
|
||||||
thread.start();
|
|
||||||
thread.join();
|
|
||||||
|
|
||||||
// Thread thread = new Thread(new Runnable() {
|
|
||||||
|
|
||||||
// @Override
|
|
||||||
// public void run() {
|
|
||||||
// try {
|
|
||||||
// result = result.concat("step 2\n");
|
|
||||||
// URL url = new URL("https://alexmahr.de/word");
|
|
||||||
// result = result.concat("step 3\n");
|
|
||||||
// HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
|
|
||||||
// result = result.concat("step 4\n");
|
|
||||||
// BufferedReader in = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
|
|
||||||
// result = result.concat("step 5\n");
|
|
||||||
// String inputLine;
|
|
||||||
// StringBuffer response = new StringBuffer();
|
|
||||||
// result = result.concat("step 6\n");
|
|
||||||
|
|
||||||
// while ((inputLine = in.readLine()) != null) {
|
|
||||||
// result = result.concat("step 7\n");
|
|
||||||
// response.append(inputLine);
|
|
||||||
// }
|
|
||||||
// result = result.concat("step 8\n");
|
|
||||||
// in.close();
|
|
||||||
// result = result.concat("step 9\n");
|
|
||||||
// result = result.concat( "OK".concat(response.toString()));
|
|
||||||
// urlConnection.disconnect();
|
|
||||||
|
|
||||||
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// e.printStackTrace();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// thread.start();
|
|
||||||
// thread.join();
|
|
||||||
tv.setText( result);
|
tv.setText( result);
|
||||||
setContentView(tv);
|
setContentView(tv);
|
||||||
try{
|
|
||||||
// TimeUnit.SECONDS.sleep(1);
|
|
||||||
} catch (Exception e){
|
|
||||||
// throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
tv.setText(result.concat(threads1.result));
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,47 +0,0 @@
|
||||||
import android.os.Bundle
|
|
||||||
import android.view.Menu
|
|
||||||
import android.view.MenuItem
|
|
||||||
import android.widget.Toast
|
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
|
||||||
|
|
||||||
class MainActivity : AppCompatActivity() {
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
|
||||||
super.onCreate(savedInstanceState)
|
|
||||||
setContentView(R.layout.activity_main)
|
|
||||||
|
|
||||||
// calling this activity's function to
|
|
||||||
// use ActionBar utility methods
|
|
||||||
val actionBar = supportActionBar
|
|
||||||
|
|
||||||
// providing title for the ActionBar
|
|
||||||
actionBar!!.title = " GfG | Action Bar"
|
|
||||||
|
|
||||||
// providing subtitle for the ActionBar
|
|
||||||
actionBar.subtitle = " Design a custom Action Bar"
|
|
||||||
|
|
||||||
// adding icon in the ActionBar
|
|
||||||
actionBar.setIcon(R.drawable.app_logo)
|
|
||||||
|
|
||||||
// methods to display the icon in the ActionBar
|
|
||||||
actionBar.setDisplayUseLogoEnabled(true)
|
|
||||||
actionBar.setDisplayShowHomeEnabled(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
// method to inflate the options menu when
|
|
||||||
// the user opens the menu for the first time
|
|
||||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
|
||||||
menuInflater.inflate(R.menu.main, menu)
|
|
||||||
return super.onCreateOptionsMenu(menu)
|
|
||||||
}
|
|
||||||
|
|
||||||
// methods to control the operations that will
|
|
||||||
// happen when user clicks on the action buttons
|
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
|
||||||
when (item.itemId) {
|
|
||||||
R.id.search -> Toast.makeText(this, "Search Clicked", Toast.LENGTH_SHORT).show()
|
|
||||||
R.id.refresh -> Toast.makeText(this, "Refresh Clicked", Toast.LENGTH_SHORT).show()
|
|
||||||
R.id.copy -> Toast.makeText(this, "Copy Clicked", Toast.LENGTH_SHORT).show()
|
|
||||||
}
|
|
||||||
return super.onOptionsItemSelected(item)
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,93 +0,0 @@
|
||||||
package de.alexmahr.app1;
|
|
||||||
|
|
||||||
//#import android.support.v7.app.AppCompatActivity
|
|
||||||
import android.os.Bundle
|
|
||||||
import android.util.Log;
|
|
||||||
import android.widget.TextView;
|
|
||||||
import android.app.Activity;
|
|
||||||
//import java.io.BufferedReader;
|
|
||||||
//import java.io.IOException;
|
|
||||||
//import java.io.InputStreamReader;
|
|
||||||
//import java.io.OutputStream;
|
|
||||||
//import java.net.HttpURLConnection;
|
|
||||||
//import java.net.URL;
|
|
||||||
//import java.lang.Thread;
|
|
||||||
//import java.util.concurrent.TimeUnit;
|
|
||||||
//import android.text.method.ScrollingMovementMethod;
|
|
||||||
|
|
||||||
public class App1 extends Activity{
|
|
||||||
{
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
|
||||||
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
val tv = TextView(this);
|
|
||||||
tv.setText( "result");
|
|
||||||
setContentView(tv);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// @Override
|
|
||||||
// public void onCreate(Bundle savedInstanceState)
|
|
||||||
// {
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// super.onCreate(savedInstanceState);
|
|
||||||
// //volatile String result = "initial";
|
|
||||||
// String result = "initial";
|
|
||||||
// TextView tv = new TextView(this);
|
|
||||||
// tv.setMovementMethod(new ScrollingMovementMethod());
|
|
||||||
// Threads1 threads1 = new Threads1();
|
|
||||||
// Thread thread = new Thread(threads1);
|
|
||||||
// thread.start();
|
|
||||||
// thread.join();
|
|
||||||
//
|
|
||||||
// // Thread thread = new Thread(new Runnable() {
|
|
||||||
//
|
|
||||||
// // @Override
|
|
||||||
// // public void run() {
|
|
||||||
// // try {
|
|
||||||
// // result = result.concat("step 2\n");
|
|
||||||
// // URL url = new URL("https://alexmahr.de/word");
|
|
||||||
// // result = result.concat("step 3\n");
|
|
||||||
// // HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
|
|
||||||
// // result = result.concat("step 4\n");
|
|
||||||
// // BufferedReader in = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
|
|
||||||
// // result = result.concat("step 5\n");
|
|
||||||
// // String inputLine;
|
|
||||||
// // StringBuffer response = new StringBuffer();
|
|
||||||
// // result = result.concat("step 6\n");
|
|
||||||
//
|
|
||||||
// // while ((inputLine = in.readLine()) != null) {
|
|
||||||
// // result = result.concat("step 7\n");
|
|
||||||
// // response.append(inputLine);
|
|
||||||
// // }
|
|
||||||
// // result = result.concat("step 8\n");
|
|
||||||
// // in.close();
|
|
||||||
// // result = result.concat("step 9\n");
|
|
||||||
// // result = result.concat( "OK".concat(response.toString()));
|
|
||||||
// // urlConnection.disconnect();
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// // } catch (Exception e) {
|
|
||||||
// // e.printStackTrace();
|
|
||||||
// // }
|
|
||||||
// // }
|
|
||||||
// // });
|
|
||||||
// // thread.start();
|
|
||||||
// // thread.join();
|
|
||||||
// tv.setText( result);
|
|
||||||
// setContentView(tv);
|
|
||||||
// try{
|
|
||||||
// // TimeUnit.SECONDS.sleep(1);
|
|
||||||
// } catch (Exception e){
|
|
||||||
//// throw new RuntimeException(e);
|
|
||||||
// }
|
|
||||||
// tv.setText(result.concat(threads1.result));
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// throw new RuntimeException(e);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//}
|
|
BIN
apk/src/main
BIN
apk/src/main
Binary file not shown.
|
@ -1,6 +0,0 @@
|
||||||
#include<stdio.h>
|
|
||||||
|
|
||||||
int main(){
|
|
||||||
printf("hallo");
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,32 +0,0 @@
|
||||||
[alex@thinkbox android-app-docker]$ git status
|
|
||||||
On branch master
|
|
||||||
Changes to be committed:
|
|
||||||
(use "git restore --staged <file>..." to unstage)
|
|
||||||
renamed: apk/src/com/example/hellojni/HelloJNI.java -> apk/src/de/alexmahr/app1/HelloJNI.java
|
|
||||||
|
|
||||||
Changes not staged for commit:
|
|
||||||
(use "git add/rm <file>..." to update what will be committed)
|
|
||||||
(use "git restore <file>..." to discard changes in working directory)
|
|
||||||
modified: apk/AndroidManifest.xml
|
|
||||||
modified: apk/Makefile
|
|
||||||
modified: apk/res/layout/main.xml
|
|
||||||
modified: apk/res/values/strings.xml
|
|
||||||
deleted: apk/src/com/example/hellojni/R.java
|
|
||||||
deleted: apk/src/de/alexmahr/app1/HelloJNI.java
|
|
||||||
|
|
||||||
Untracked files:
|
|
||||||
(use "git add <file>..." to include in what will be committed)
|
|
||||||
apk/CMakeLists.txt
|
|
||||||
apk/build.prop
|
|
||||||
apk/jni/
|
|
||||||
apk/kotlin-compiler-1.9.0.zip
|
|
||||||
apk/kotlin-native-linux-x86_64-1.9.0.tar.gz
|
|
||||||
apk/kotlinc/
|
|
||||||
apk/src/de/alexmahr/app1/App1.java
|
|
||||||
apk/src/de/alexmahr/app1/App1.kt
|
|
||||||
apk/src/de/alexmahr/app1/App1.kt.back
|
|
||||||
apk/src/de/alexmahr/app1/R.java
|
|
||||||
apk/src/main
|
|
||||||
apk/src/main.c
|
|
||||||
docker-compose-build.log
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue