Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Mobile Development > BOOK: Beginning Android Application Development
|
BOOK: Beginning Android Application Development
This is the forum to discuss the Wrox book Beginning Android Application Development by Wei-Meng Lee; ISBN: 978-1-1180-1711-1
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Android Application Development section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 21st, 2011, 04:23 PM
Registered User
 
Join Date: Oct 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 3 - <Orientations> program - MainActivity.java is empty?!

The Chapter 3 "Orientations" program seems to do absolutely nothing!?

I checked both .zip files (all code, and chapter 3 only) and MainActivity.java is empty in both.

My main concern is using the TableLayout, both statically and programmatically.

Am I simply missing something (new to Android, coming from C++/C#, etc)? Was there supposed to be a 4th example in Chapter 3?

Both other Chapter 3 examples seem to work fine but demonstrate little or nothing about TableLayout.

Is there a working example using TableLayout later in the book?

Thanks in advance
--Ken
 
Old October 22nd, 2011, 07:08 AM
Registered User
 
Join Date: Oct 2011
Posts: 12
Thanks: 0
Thanked 2 Times in 1 Post
Default

Obviously not much help, but it does appear that the MainActivity.java file is empty in the sample code.

Not done the chapter 3 stuff yet so I can't help with the other question.
 
Old October 22nd, 2011, 01:12 PM
Registered User
 
Join Date: Oct 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 3 - <Orientations> program - MainActivity.java is empty?!

Haven't tried either yet, but I found this at Stack Overflow:

http://stackoverflow.com/questions/1...rogramatically

Which led to this (way down at the bottom):

http://huuah.com/using-tablelayout-on-android/

looks just right for my purposes

Thanks,
--Ken
 
Old December 30th, 2011, 02:51 AM
Authorized User
 
Join Date: Dec 2011
Posts: 10
Thanks: 3
Thanked 0 Times in 0 Posts
Default fwiw, here's the code; you can cut and paste

Code:
package com.xyz.orientations; // don't forget to fix this to whatever your package name is!!

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
public class MainActivity extends Activity
	{
/**Called when the activity is first created.*/
	@Override
	public void onCreate(Bundle savedInstanceState)
		{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
        Log.d("StateInfo", "onCreate");
		}
	@Override
    public void onStart()
		{
        Log.d("StateInfo", "onStart");
        super.onStart();
		}
    @Override
    public void onResume()
    	{
        Log.d("StateInfo", "onResume");
        super.onResume();
    	}
    @Override
    public void onPause()
    	{
        Log.d("StateInfo", "onPause");
        super.onPause();
    	}
    @Override
    public void onStop()
    	{
        Log.d("StateInfo", "onStop");
        super.onStop();
    	}
    @Override
    public void onDestroy()
    	{
        Log.d("StateInfo", "onDestroy");
        super.onDestroy();
    	}
    @Override
    public void onRestart()
    	{
        Log.d("StateInfo", "onRestart");
        super.onRestart();
    	}
	}





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 8 - <Networking> program BrianMcK BOOK: Beginning Android Application Development 1 October 21st, 2011 09:54 AM
Chapter 8 - <EMails> program BrianMcK BOOK: Beginning Android Application Development 1 October 21st, 2011 09:49 AM
Chapter 2 - <Intents> program BrianMcK BOOK: Beginning Android Application Development 1 October 21st, 2011 09:31 AM
<<ASP.NET Security>>,download files in chapter 8 alaix All Other Wrox Books 1 July 24th, 2003 10:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.