Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » First Android App Problems(BuildConfig Class and @drawable/ ic_launcher)
icon5.gif  First Android App Problems [message #1007467] Wed, 06 February 2013 01:56 Go to next message
Patrick Mullen is currently offline Patrick Mullen
Messages: 1
Registered: February 2013
Junior Member
First time learning my way around java, xml and eclipse.

Trying to compile a basic webview app for the Play store that, when launched, simply displays a mobile website already hosted.

I create a new Android Application Project > blank activity and use the following:

For my manifest.xml
Quote:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="schemas.android.com/apk/res/android"
package="com.droidbuffalo "
android:versionCode="1"
android:installLocation="auto"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<application android:icon="@drawable/ ic_launcher"
android:label="@string/app_name">
<activity android:name=".main "
android:theme="@android:style/Theme.NoTitleBar"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.INTERNET" />
</manifest>"



For my main activity xml
Quote:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFF"
>
<WebView xmlns:android="schemas.android.com/apk/res/android"
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
<Button
android:id="@+id/btn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="buy tickets"
android:textColor="#000"
/>
</LinearLayout



The main activity java under src
Quote:
package com.droidbuffalo;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
import android.widget.Button;
import android.webkit.WebViewClient;
import android.view.KeyEvent;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;
import android.net.Uri;

public class Main extends Activity {
WebView mWebView;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setBuiltInZoomControls(true);
mWebView.getSettings().setUseWideViewPort(true);
mWebView.loadUrl("mywebsite");
mWebView.setWebViewClient(new HelloWebViewClient());
Button btn=(Button)findViewById(R.id.btn);
btn.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
Uri uri = Uri.parse("mywebsite");
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(uri);
startActivity(intent);
}
}
);

}
private class HelloWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if ((keyCode == KeyEvent.KEYCODE_BACK) && mWebView.canGoBack()) {
mWebView.goBack();
return true;
}
return super.onKeyDown(keyCode, event);
}
}



I am getting the following errors and don't know what to do / what I am doing wrong.

-Failed to create BuildConfig class

-R cannot be resolved to a variable for the src java @ setContentView(R.layout.main);

-XML document structures must start and end within the same entity


Can anyone give me some advice or help? Sad

I had to remove the http from the xmlns part because I am under 5 posts.

Best Regards


Re: First Android App Problems [message #1007581 is a reply to message #1007467] Wed, 06 February 2013 15:02 Go to previous message
Russell Bateman is currently offline Russell Bateman
Messages: 3196
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 2/6/2013 6:52 AM, Patrick Mullen wrote:
> First time learning my way around java, xml and eclipse.
>
> Trying to compile a basic webview app for the Play store that, when
> launched, simply displays a mobile website already hosted.
>
> I create a new Android Application Project > blank activity and use the
> following:

Always read sticky posts at top of a new forum; here's one:

http://www.eclipse.org/forums/index.php/t/225513/
Previous Topic:Can't get "ahtik" word-wrap plugin to work
Next Topic:org.w3.dom.css; version=2.0.0
Goto Forum:
  


Current Time: Tue Sep 23 00:36:09 GMT 2014

Powered by FUDForum. Page generated in 0.03547 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software