`
Entesar
  • 浏览: 1919 次
文章分类
社区版块
存档分类
最新评论

First project in android

阅读更多

Yesterday i learned how to program and make  application using 

 

Android in eclipse 
i just learned the basics of it .
1) how to design ,add buttons , layouts,textfeilds ,pictures...etc
2)how to jump from page to page using onClickListener and intent . 

 

Steps for creating new project.

 

First step is to create new android application

 

1.File->New->Android application project;

 

2.Write the Application name;

 

3.minimum required SDK and target SDK change it to android 4.0;

 

4.next->next

 

5.Configure launcher icon (change the icon of your application as you like, adding picture, change the shape…etc.

 

6. create activity you can choose anything you want.

 

7. next-> finish.

 

 

According to my understanding, I wrote a very simple login application named it Funny. Firstly if the user has an account and he/she inputs the right account then click the login yellow button-this means login- It will jump to the next page and Welcome the user for entering the page.- it means welcome to my page-

I used onClickListener and intent for doing this function.

 

Second If the user don’t have account, he/she will register for new account so I add another button for this function (gray button)-this button means signup -. when the user click this button it will jump to the register page.

 

First line means enter name ;

Second means enter the password;

Third enter your email address;

 

 

 

 

I made a very simple application because my laptop is too slow , every step really takes a long time .I hope that I will improve my application and make it more creative.

 

These are my pages.

 

  
   
 


When I finished this program I remember that I have to change the buttons in the first page to like the button in the register page but I found an error .

 

Unfortunately, Funny has stopped.

the error was because of unused linear veiw. 

 

 
 
 this is my code:

package com.example.funny;





public class Secondpage extends Activity{
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_second);
	}

}

 
 
 

package com.example.funny;


public class MainActivity extends Activity {
	Button login;
	Button signup;
	EditText account;
	TextView check;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		signup=(Button)super.findViewById(R.id.signup);
		login=(Button)super.findViewById(R.id.login);
		account=(EditText)super.findViewById(R.id.account);
		check=(TextView)super.findViewById(R.id.check);
		
	login.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				if(account.getText().toString().equals("8888")){
				check.setText(account.getText());
				
				  
				  				Intent t=new Intent(MainActivity.this,Secondpage.class);			
				  				MainActivity.this.startActivity(t);
				}
				
			}
		});
	
	signup.setOnClickListener(new OnClickListener() {
		
		@Override
		public void onClick(View v) {
			// TODO Auto-generated method stub
		
			
			  
			  				Intent t=new Intent(MainActivity.this,Register.class);			
			  				MainActivity.this.startActivity(t);
		
			
		}
	});
	}

	
	
}

 

package com.example.funny;



public class Register extends Activity{

	
protected void onCreate(Bundle savedInstanceState) {
			super.onCreate(savedInstanceState);
			setContentView(R.layout.activity_register);
		}


}

 
 
I found some difficulties because Arabic language starts from right to left opposite to English .

  • 大小: 15.6 KB
  • 大小: 721 Bytes
  • 大小: 847 Bytes
  • 大小: 1.4 KB
  • 大小: 2.9 KB
  • 大小: 16.6 KB
  • 大小: 12.8 KB
1
0
分享到:
评论
2 楼 masuweng 2017-07-01  
      很好,有时间了学习下。
1 楼 梳子不爱头发 2017-06-30  

相关推荐

    Embedded Programming with Android: Bringing Up an Android System from Scratch

    The first title in Addison-Wesley’s new Android™ Deep Dive series for intermediate and expert Android developers, Embedded Programming with Android™ draws on Roger Ye’s extensive experience with ...

    Android代码-WIFIADB

    The first one is an android project,and the second is an intellij plugin project. You can see more information in the respective project,and I hope you can tell me your suggestions. Developed By ...

    Android Apprentice (Third Edition) Beginning Android Development

    If you’re completely new to Android or developing in Kotlin, this is the book for you. Android Apprentice takes you all the way from building your first app, to submitting your app for sale. By ...

    Android代码-Thugaim

    First you will need the Android SDK and support for Android API 8 . Then locate the executable android in the SDK under sdk/tools/. From the project directory, execute: /PATH/TO/ANDROID/sdk/tools/...

    Android代码-android

    In order to build using the appMobi code base you will first need the appropriate tools. For iOS, refer to http://developer.apple.com/xcode/index.php For Android, refer to the instructions at ...

    Android代码-Android Common Library Samples

    Some modules of project contain dependencies not included in Maven Central - to build such modules you need first install these dependencies in your local repository. To do this, please, download ...

    50-Android-Hacks.pdf

    In July 2009, thanks to a friend living in Australia, I got my first Android-powered device, an HTC Magic with Android version 1.5. To be honest, it processed more slowly than I expected, but I ...

    Android代码-mirror

    While the time, date, and news show up without any additional changes, you need to first enable the respective APIs in order to see the weather, commute, and body measures. Edit keys.xml and enter the...

    Introduction.to.Android.Application.Development(4th,2013.12) pdf

    Running Your Android Application in the Emulator 76 Debugging Your Android Application in the Emulator 80 Adding Logging Support to Your Android Application 83 Adding Some Media Support to Your ...

    Android Application Development Cookbook: 93 Recipes for Building Winning Apps

    The popularity of Google Android devices is seemingly unstoppable and the Android 4 release offers, for the first time, a single OS solution for building both phone and tablet applications. With that ...

    Android代码-密码保管软件

    This is a mobile application I have created in an attempt to improve my online account security, it is the Android version of my Secure Sign In project. Benifits: Remember one password for all sites,...

    Android Studio Application Development

    Explore the various features involved in developing an android app and implement them In Detail Mobile apps have become extremely popular over the last few years and offer a great opportunity for ...

    Android代码-android-obd-reader

    I can't even remember when I first picked this project from Brice Lambi (the original author). But one thing I'm sure, it was a time my interests changed quite frequently and I'd contribute ...

    Android代码-计数器

    This was my first Android application. The goal was to make something easy to build. It's not very complex. I hope you'll find this project useful. ⚠️ Keep in mind that I'm no longer actively ...

    Beginning.Android.5th.Edition.1430246863

    Chapter 3: Inside Your First Android Project Chapter 4: Changing and Enhancing Your Project Part II: Activities and the User Interface Chapter 5: Working with Android Widgets Chapter 6: Layouts and ...

    Android代码-TvRecyclerView

    To add gradle dependency you need to open build.gradle (in your app folder,not in a project folder) then copy and add the dependencies there in the dependencies block; 2.Add TvRecyclerView in your ...

    Android 4 游戏开发入门(Beginning Android 4 Games Development)

    How to set up and use the development tools for developing your first Android 4 or earlier version game app * The fundamentals of game programming in the context of the Android platform * How to use ...

    Introduction to Android™ Application Fourth Edition pdf

    the development tools, and write and run your first Android application—on the An Overview of Changes in This Edition 3 emulator and on a handset. This section is of primary interest to developers ...

Global site tag (gtag.js) - Google Analytics