android怎么写代码

1.android studio 怎么写代码您好,Android Studio每次更新版本都会更新Gradle这个插件,但由于长城的问题每次更新都是失败,又是停止在Refreshing Gradle
Project ,有时新建项目的时候报 Gradle Project Compile Error 等等相关的问题
解决这些问题办法是
首先打开android studio项目 找到项目目录gradle\wrapper\gradle-wrapper.properties这个文件
内容如下
#Wed Apr 10 15:27:10 PDT
2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#FFFFFF" > 2、代码如下 //得到 mapButtonRL = (RelativeLayout) findViewById(R.id.anquan_map_l1); RelativeLayout.LayoutParams lp1 = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); lp1.addRule(RelativeLayout.BELOW, R.id.btn_of_layer); showModeButton = new Button(this); showModeButton.setText("全部显示"); showModeButton.setId(SHOW_MODE); showModeButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { } }); mapButtonRL.addView(showModeButton, lp1); RelativeLayout.LayoutParams lp2 = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); lp2.addRule(RelativeLayout.BELOW, SHOW_MODE); positionButton = new Button(this); positionButton.setText("位置"); positionButton.setId(POSITION); positionButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { } }); mapButtonRL.addView(positionButton, lp2); 。
3.手机拨号盘在android中怎样写代码 第一步是为这个活动创建一个项目,把项目命名为AndroidPhoneDialer 。
下面的插图就是这个项目的新Android项目向导(略) 。在Eclipse内打开的新的应用程序,第一个要做的就是从main.xml中移除包含Hello World 声明的TextView 。
在删除了TextView后,main.xml文件应当看起来如下:<?xml version="1.0" encoding="utf-8"?> 你需要增加两个新的包装到你的项目中来使用DIAL_ACTION Intent,如下,第一个包装允许你设置Intents并且第二个允许你来分析URIs 。import android.content.Intent; import android.net.Uri;注意 对于DIAL_ACTION这个Intent有一些不同的Intent过滤器可以使用 。
你正在使用的是允许你把号码作为了一个URI来传递的过滤器 。下一步就是来创建你的Intent 。