[android-developers] Re: Android Layouts Are Horrible
I agree with Dirk and others. After using Microsofts development environment, Visual Studio and asp.net for me, there is no reason to code database connections, html tables of data etc., sql update, delete and insert commands. If you know them that is great and it is helpful. But by having a full mature visual development environment you can concentrate on the application and not the code, unless necessary. I have developed a fully functional asp.net application with 53 database driven pages with lists and forms with full insert update and delete capabilities, full security with logins, retrieve passwords, create new users all in 2 weeks. No code! Later we added business rules and error trapping but what a head start. If needed then you dig into code but use the built in mature tools to the fullest. I had a problem once and got answers of 150 lines of code. The solution was 1 line of code. We do not need to reinvent the wheel on every application. Thirty years ago we had database application software that didn't require you to code database connections, insert, deletes and update statements, button clicks etc. I hope we have progressed farther that that. Eclipse is the best visual environment for Android code but far from Microsofts Visual Studio development environment. Ever seen app_inventor, visual environment from Google? Interesting. I wonder if it will ever be released? It may be too visual and maybe no as powerful, butinteresting none the less. On Apr 5, 1:19 am, dirk dhaa...@gmail.com wrote: Hold on a minute. I really don't care the least bit about underlying code, that is, the XML that's generated by a really good design tool. Saying you should have to learn the XML (in this case) is like saying you have to learn the bytecode that's generated from the java code. Sure, you always need understand the structure, but with good tools, you can _focus_ on the structure and not worry about the details. On Apr 4, 7:01 pm, Robert rcope...@gmail.com wrote: Layout is part of development. Having tools to help with that are aids but should not be used as an excuse not to learn the underlying code. THe designer tools only generate the structures based on the rules programmed into them. You will always have a more detailed level of control by going to the lowest level available. Learn it and it'll make you a better developer and your programs to be more efficient. Using the higher level tools makes you only as efficient at they are. Yes, it takes time and yes you have to learn it but that's what being a real developer is all about. Robert- Hide quoted text - - Show quoted text - -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: WebView and Linear Layout
This works for me at its simplest. ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/ android android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent WebView android:id=@+id/webview android:layout_width=fill_parent android:layout_height=0dip android:layout_weight=1/ /LinearLayout On Feb 19, 12:07 pm, Gareth dr.g.o...@gmail.com wrote: Hi all I am developing a web app for a tablet. If I just place a WebView in the layout file it works fine except the WebView doesn't fill the whole screen on the tablet. If I then put the WebView in a Linear Layout on its own - the application crashes on start up saying it was forced to close! Any ideas on how to get a WebView to fill the whole screen? Thanks Gareth PS - crashing layout file as follows ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/ android android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent WebView xmlns:android=http://schemas.android.com/apk/res/android; android:id=@+id/webview android:layout_width=fill_parent android:layout_height=fill_parent / /LinearLayout -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: WebView Page Not Found Error Trapping
I got it to work public class Main extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Let's display the progress in the activity titlebar, like the browser app does this.getWindow().requestFeature(Window.FEATURE_PROGRESS); setContentView(R.layout.main); WebView webview = new WebView(this); setContentView(webview); WebSettings webSettings = webview.getSettings(); setProgressBarVisibility(true); webview.getSettings().setJavaScriptEnabled(true); // Make the zoom controls visible webSettings.setBuiltInZoomControls(true); final Activity activity = this; webview.setWebChromeClient(new WebChromeClient() { public void onProgressChanged(WebView view, int progress) { activity.setProgress(progress * 100 ); } }); // Creating and setting a WebViewClient subclass. // It will be called when things happen that impact the rendering of the content, // eg, errors or form submissions. You can also intercept URL loading here (via shouldOverrideUrlLoading()). webview.setWebViewClient(new WebViewClient() { public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { Toast.makeText(activity, Internet connection down? + description, Toast.LENGTH_SHORT).show(); view.loadData(Your internet connection may be down? Please restart your app., text/html, UTF-8); } }); // Go to a web page webview.loadUrl(http://www.MyWebsite.com;); } } On Feb 14, 2:51 pm, Craigbtx craig...@austin.rr.com wrote: Can you give me some sample code? I am learning and only done android programming for 2-3 weeks. On Feb 14, 2:26 pm, Mark Murphy mmur...@commonsware.com wrote: On Mon, Feb 14, 2011 at 3:23 PM, Craigbtx craig...@austin.rr.com wrote: I have the OnReceivedError event I get the dialog Internet Down message but the page not found still shows in hte background. Is there some way around this? Like show a blank screen saying error: Site down. Try later or something? Call loadUrl() or loadData() or loadDataWithBaseURL() with whatever you want. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy Android Training...At Your Office:http://commonsware.com/training- Hide quoted text - - Show quoted text - -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] WebView Page Not Found Error Trapping
I am using webview. If the page is not correct or the website is down, how can I error trap a page not found and show the users an error page or some othe page? I am very much a beginner so I need examples of code. @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); WebView webview = new WebView(this); setContentView(webview); WebSettings webSettings = webview.getSettings(); webSettings.setJavaScriptEnabled(true); webSettings.setBuiltInZoomControls(true); // No error trapping webview.setWebViewClient(new WebViewClient()); webview.loadUrl(http://www.MyWebsite.com;); -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: WebView Page Not Found Error Trapping
I have the OnReceivedError event I get the dialog Internet Down message but the page not found still shows in hte background. Is there some way around this? Like show a blank screen saying error: Site down. Try later or something? Thanks @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Needed for progress bar // Let's display the progress in the activity titlebar, like the browser app does this.getWindow().requestFeature(Window.FEATURE_PROGRESS); setContentView(R.layout.main); // WORKS WITH PROGRESS BAR WebView webview = new WebView(this); setContentView(webview); WebSettings webSettings = webview.getSettings(); setProgressBarVisibility(true); webview.getSettings().setJavaScriptEnabled(true); // Make the zoom controls visible webSettings.setBuiltInZoomControls(true); final Activity activity = this; webview.setWebChromeClient(new WebChromeClient() { public void onProgressChanged(WebView view, int progress) { activity.setProgress(progress * 100 ); } }); webview.setWebViewClient(new WebViewClient() { public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { Toast.makeText(activity, Internet connection down? + description, Toast.LENGTH_SHORT).show(); } }); // Go to a web page webview.loadUrl(http://www.MySite.com/Default.aspx;); } On Feb 14, 12:24 pm, Mark Murphy mmur...@commonsware.com wrote: Implement onReceivedError() in your WebViewClient. On Mon, Feb 14, 2011 at 1:21 PM, Craigbtx craig...@austin.rr.com wrote: I am using webview. If the page is not correct or the website is down, how can I error trap a page not found and show the users an error page or some othe page? I am very much a beginner so I need examples of code. @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); WebView webview = new WebView(this); setContentView(webview); WebSettings webSettings = webview.getSettings(); webSettings.setJavaScriptEnabled(true); webSettings.setBuiltInZoomControls(true); // No error trapping webview.setWebViewClient(new WebViewClient()); webview.loadUrl(http://www.MyWebsite.com;); -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, One Low Price!- Hide quoted text - - Show quoted text - -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: WebView Page Not Found Error Trapping
Can you give me some sample code? I am learning and only done android programming for 2-3 weeks. On Feb 14, 2:26 pm, Mark Murphy mmur...@commonsware.com wrote: On Mon, Feb 14, 2011 at 3:23 PM, Craigbtx craig...@austin.rr.com wrote: I have the OnReceivedError event I get the dialog Internet Down message but the page not found still shows in hte background. Is there some way around this? Like show a blank screen saying error: Site down. Try later or something? Call loadUrl() or loadData() or loadDataWithBaseURL() with whatever you want. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy Android Training...At Your Office:http://commonsware.com/training -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Error trap webview.loadUrl
Are there any example? I can't seem to find any. Thanks On Jan 14, 6:47 pm, TreKing treking...@gmail.com wrote: On Thu, Jan 13, 2011 at 6:27 AM, Craigbtx craig...@austin.rr.com wrote: When using the Webview how do you error trap webview.loadUrl(http:// MyURL.com) when a internet connection does not exist? Maybe this:http://developer.android.com/reference/android/webkit/WebViewClient.h..., int, java.lang.String, java.lang.String) http://developer.android.com/reference/android/webkit/WebViewClient.h..., int, java.lang.String, java.lang.String)From a 2 second gleam of the docs. ----- TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Error trap webview.loadUrl
When using the Webview how do you error trap webview.loadUrl(http:// MyURL.com) when a internet connection does not exist? Thanks Android newbie! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Default keyboard in application
I am real new to android development. I am using the WebView view to display a webpage inside the android app When a user touches a textbox in the web page, can I set the virtual keyboard that comes up to be a numeric keyboard? In fact the default keyboard for my whole web app can always be numeric. Thanks Craigbtx I was hoping to set some property in my code below, like you might do for a TextView. Listed below is all my code. LinearLayout xmlns:android=http://schemas.android.com/apk/res/ android android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent WebView android:id=@+id/webview android:layout_width=fill_parent android:layout_height=0dip android:layout_weight=1 / public class WebViewDemo extends Activity { private static final String True = null; /** Called when the activity is first created. */ /** private static final String LOG_TAG = WebViewDemo; private WebView mWebView; private Handler mHandler = new Handler(); */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); WebView webview = new WebView(this); setContentView(webview); // Simplest usage: note that an exception will NOT be thrown WebSettings webSettings = webview.getSettings(); webSettings.setJavaScriptEnabled(true); // Make the zoom controls visible webSettings.setBuiltInZoomControls(true); //Open clicked links in this WebView view webview.setWebViewClient(new WebViewClient()); // Go to a web page webview.loadUrl(http://192.168.1.101/PhoneApps/Default.aspx } } -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en