I have installed Android Studio.
When I Create a New Device I have to be careful.
When I created a Nexus 5X 1080x1920 it does not allow me to change from Emulated Performance|Graphics|Automatic This kept on causing the virtual device to freeze or the emulator timing out before coming online.
My machine is a Intel Pentium Quad Core 2.58GHz, Intel HD Graphics, 8GB DDR3 L Memory.
Since I have just onboard graphics, I thought I would try for a lighter Virtual Device. I chose 5.1 WVGA API 27.
This time I can change Emulated Performance|Graphics. When I have Automatic or Hardware it freezes again.
Sometimes it repeatedly says:
When I have it on Emulated Performance|Graphics|Software it goes in a perpetual loop trying to launch the machine or install the apk, but never succeeding.
How can I get this to work?
My Code:
MainActivity.java
Android Manifest
index.html
When I Create a New Device I have to be careful.
When I created a Nexus 5X 1080x1920 it does not allow me to change from Emulated Performance|Graphics|Automatic This kept on causing the virtual device to freeze or the emulator timing out before coming online.
My machine is a Intel Pentium Quad Core 2.58GHz, Intel HD Graphics, 8GB DDR3 L Memory.
Since I have just onboard graphics, I thought I would try for a lighter Virtual Device. I chose 5.1 WVGA API 27.
This time I can change Emulated Performance|Graphics. When I have Automatic or Hardware it freezes again.
Sometimes it repeatedly says:
W/zygote: Attempt to remove non-JNI local reference, dumping thread
When I have it on Emulated Performance|Graphics|Software it goes in a perpetual loop trying to launch the machine or install the apk, but never succeeding.
How can I get this to work?
My Code:
MainActivity.java
Java:
package com.example.jon.testandroid;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
// Used to load the 'native-lib' library on application startup.
static {
System.loadLibrary("native-lib");
}
[USER=1021285]@override[/USER]
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Example of a call to a native method
TextView tv = (TextView) findViewById(R.id.sample_text);
tv.setText(stringFromJNI());
WebView webview = (WebView)findViewById(R.id.webView);
webview.getSettings().setJavaScriptEnabled(true);
webview.setWebChromeClient(new WebChromeClient());
webview.loadUrl("file:///android_asset/www/index.html");
}
/**
* A native method that is implemented by the 'native-lib' native library,
* which is packaged with this application.
*/
public native String stringFromJNI();
}
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.jon.testandroid">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="[USER=22138]@Mipmap[/USER]/ic_launcher"
android:label="[USER=696546]@String[/USER]/app_name"
android:roundIcon="[USER=22138]@Mipmap[/USER]/ic_launcher_round"
android:supportsRtl="true"
android:theme="[USER=19691]@Style[/USER]/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
HTML:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is a Heading</h1>
<p id="id">This is a paragraph.</p>
<button onclick="alert('Hello')">Say Hello</button>
</body>
</html>
Last edited by a moderator: