当前位置: 编程技术>移动开发
本页文章导读:
▪2011年口试整理 2011年面试整理
1.博彦科技1. 线程(新建,就绪,运行,阻塞,死亡)2. Public作用域,private,package(默认),protected3. 重写与重载的区别4. Sql语句与优化5. Strust1与structs2的区别6. Spring的ioc与面向切面编程(a.........
▪ 二月22日自定义Dialog 2月22日自定义Dialog
效果图:[img][/img]工程结构图:[img][/img]dialog.xml<?xml version="1.0" encoding="utf-8"?>
<!-- 新表箱管理==自定义Dialog -->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/re.........
▪ 在google舆图上画出两点的行走路线 在google地图上画出两点的行走路线
新建一个图层
package com.android.antkingwei.google.direction;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Point;
impo.........
[1]2011年口试整理
来源: 互联网 发布时间: 2014-02-18
2011年面试整理
1.博彦科技
1. 线程(新建,就绪,运行,阻塞,死亡)
2. Public作用域,private,package(默认),protected
3. 重写与重载的区别
4. Sql语句与优化
5. Strust1与structs2的区别
6. Spring的ioc与面向切面编程(aop)
7. 八种基本类型(byte,int,char,long,float,double,Boolean,short(一个字符,2个字节=16位))
8. 栈:后进先出,堆是栈的一个组成元素
9. 存储过程,预编译的sql语句,速度快
Eg:
Create or replace procedure
As
变量声明
Begin…..
Exception…
When …..
….. 错误处理
2.博安达
1.oracle查询在一个星期内…..
2.io流复制一个小时内的文件夹道另外一个文件夹
3.js全选与否
Function checkall(boolvalue){
Var allcheckBoxs =document.getElementsByName(“isBuy”);
For(var i=0;i<allcheckBox.length;i++){
If(allcheckBOx[i].type==”checkbox”){
allcheckBox[i].checked=boolvalue;
}
}
}
4.servlet生命周期
5.structs1的配置文件与相关重要组件
6.structs1与structs2的标签及区别
7.注解的主要作用(主键,外键,一对多,多对一)
8.svn,junit
3.易思博
1.IO流2.读取xml,3.ssh,4.接口跟抽象类的区别5.ioc与aop的特点与作用6.extjs,jquery,ajax原理与执行顺序
4.凯瑞银行
1.3公斤与5公斤水桶怎么称出4公斤水
2.jsp内置对象,3.list,vector,map的区别
4.编写一个signton,5.ejb,jdbc链接6.hibernate缓存实现(get,load的区别,一级缓存,二级缓存
7.冒泡排序
Int[] scores=[90,80,90,92,95];
For(i=0;i<scores.length-1;i++){
If(socre[i]>scores[i++]){
Temp =score[i];
Score[j]=score[i];
Score[j+1]=temp;
}
}
8.ajax原理
4.软通动力
1.hashmap与hashtable的区别
2.oracle(存储过程,function,游标1)
3.数据库优化,sql优化
4.ioc,aop的作用与特点
5.structs1与structs2的区别,hibernate中get与load的区别
6.webservices是什么有什么作用
5.中软
1.读取信息
2.sql查询(学生表,课程表,分数表)
5.雁联计算机系统
1.接口跟抽象类的区别有优点
2.编写一个线程的队列
3.数据库连接池工作原理
4.string,stringbuilder,stringbufer的区别
5.sleep与waiter的区别
6.jquery怎么从后台取数据
7.hibernate缓存的实现机制
1.博彦科技
1. 线程(新建,就绪,运行,阻塞,死亡)
2. Public作用域,private,package(默认),protected
3. 重写与重载的区别
4. Sql语句与优化
5. Strust1与structs2的区别
6. Spring的ioc与面向切面编程(aop)
7. 八种基本类型(byte,int,char,long,float,double,Boolean,short(一个字符,2个字节=16位))
8. 栈:后进先出,堆是栈的一个组成元素
9. 存储过程,预编译的sql语句,速度快
Eg:
Create or replace procedure
As
变量声明
Begin…..
Exception…
When …..
….. 错误处理
2.博安达
1.oracle查询在一个星期内…..
2.io流复制一个小时内的文件夹道另外一个文件夹
3.js全选与否
Function checkall(boolvalue){
Var allcheckBoxs =document.getElementsByName(“isBuy”);
For(var i=0;i<allcheckBox.length;i++){
If(allcheckBOx[i].type==”checkbox”){
allcheckBox[i].checked=boolvalue;
}
}
}
4.servlet生命周期
5.structs1的配置文件与相关重要组件
6.structs1与structs2的标签及区别
7.注解的主要作用(主键,外键,一对多,多对一)
8.svn,junit
3.易思博
1.IO流2.读取xml,3.ssh,4.接口跟抽象类的区别5.ioc与aop的特点与作用6.extjs,jquery,ajax原理与执行顺序
4.凯瑞银行
1.3公斤与5公斤水桶怎么称出4公斤水
2.jsp内置对象,3.list,vector,map的区别
4.编写一个signton,5.ejb,jdbc链接6.hibernate缓存实现(get,load的区别,一级缓存,二级缓存
7.冒泡排序
Int[] scores=[90,80,90,92,95];
For(i=0;i<scores.length-1;i++){
If(socre[i]>scores[i++]){
Temp =score[i];
Score[j]=score[i];
Score[j+1]=temp;
}
}
8.ajax原理
4.软通动力
1.hashmap与hashtable的区别
2.oracle(存储过程,function,游标1)
3.数据库优化,sql优化
4.ioc,aop的作用与特点
5.structs1与structs2的区别,hibernate中get与load的区别
6.webservices是什么有什么作用
5.中软
1.读取信息
2.sql查询(学生表,课程表,分数表)
5.雁联计算机系统
1.接口跟抽象类的区别有优点
2.编写一个线程的队列
3.数据库连接池工作原理
4.string,stringbuilder,stringbufer的区别
5.sleep与waiter的区别
6.jquery怎么从后台取数据
7.hibernate缓存的实现机制
[2] 二月22日自定义Dialog
来源: 互联网 发布时间: 2014-02-18
2月22日自定义Dialog
效果图:
[img]
[/img]
工程结构图:
[img]
[/img]
dialog.xml
main.xml
color.xml
style.xml
MainActivity
效果图:
[img]
[/img]
工程结构图:
[img]
[/img]
dialog.xml
<?xml version="1.0" encoding="utf-8"?> <!-- 新表箱管理==自定义Dialog --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical"> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="6dip"> <TextView android:text="提示" android:layout_height="wrap_content" android:layout_width="fill_parent" android:gravity="center_horizontal" /> <TextView android:text="此用户为一户多表,请输入钢印号后四位或六位查询" android:layout_marginTop="10dp" android:layout_height="wrap_content" android:layout_width="fill_parent" android:id="@+id/newbox_tv_dialog" /> <EditText android:layout_height="wrap_content" android:id="@+id/newbox_et_dialog_madeno" android:inputType="number" android:singleLine="true" android:layout_marginTop="10dp" android:layout_width="fill_parent" /> </LinearLayout> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="center_horizontal"> <Button android:text="确定" android:id="@+id/newbox_btn_dialog_confirm" android:layout_weight="1" android:gravity="center" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <Button android:text="取消" android:id="@+id/newbox_btn_dialog_cancel" android:layout_weight="1" android:gravity="center" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> </LinearLayout>
main.xml
<?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"> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /> <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout>
color.xml
<?xml version="1.0" encoding="utf-8"?> <resources> <color name="color_dark_grey">#808080</color> <color name="color_black">#000000</color> <color name="color_green">#00FF00</color> <color name="color_red">#FF0000</color> <color name="color_white">#FFFFFF</color> </resources>
style.xml
<?xml version="1.0" encoding="utf-8"?> <resources> <!-- 正文区背景色--> <style name="bgColor" > <item name="android:background">#ffffff</item> </style> <style name="StyContent"> <item name="android:textSize">18px</item> <item name="android:textColor">#000000</item> </style> <style name="StyTitle"> <item name="android:textSize">24dip</item> <item name="android:textColor">#000000</item> </style> <style name="StyButton"> <item name="android:textSize">24dip</item> <item name="android:textColor">#303030</item> </style> <!-- Define the list items style begin --> <style name="list_item_seperator_layout"> <item name="android:layout_width">fill_parent</item> <item name="android:layout_height">1dip</item> <item name="android:background">@color/color_dark_grey</item> </style> <style name="list_item_cell_seperator_layout"> <item name="android:layout_width">1dip</item> <item name="android:layout_height">fill_parent</item> <item name="android:background">@color/color_dark_grey</item> </style> <style name="list_item_header_seperator_layout"> <item name="android:layout_width">1dip</item> <item name="android:layout_height">40dip</item> <item name="android:background">@color/color_dark_grey</item> </style> <!-- Define the list items style end --> <style name="MyDialog" parent="@android:Theme.Dialog"> <item name="android:windowFrame">@null</item> <item name="android:windowNoTitle">true</item> <item name="android:windowIsFloating">true</item> <item name="android:windowContentOverlay">@null</item> </style> </resources>
MainActivity
package com.zzl.dialog; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; public class MainActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button btn = (Button) findViewById(R.id.button1); btn.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { //初始化一个自定义的Dialog LayoutInflater factory = LayoutInflater.from(MainActivity.this); final View DialogView = factory.inflate(R.layout.dialog, null); final Dialog dialog = new Dialog(MainActivity.this,R.style.MyDialog); dialog.setContentView(DialogView); dialog.show(); final EditText et = (EditText) DialogView.findViewById(R.id.newbox_et_dialog_madeno); Button btn = (Button) DialogView.findViewById(R.id.newbox_btn_dialog_confirm); btn.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { String str = et.getText().toString(); dialog.cancel(); Toast.makeText(getApplicationContext(), "测试="+str, 0).show(); } }); } }); } }
[3] 在google舆图上画出两点的行走路线
来源: 互联网 发布时间: 2014-02-18
在google地图上画出两点的行走路线
新建一个图层
package com.android.antkingwei.google.direction; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Point; import com.google.android.maps.GeoPoint; import com.google.android.maps.MapView; import com.google.android.maps.Overlay; import com.google.android.maps.Projection; public class DirectionPathOverlay extends Overlay { private GeoPoint gp1; private GeoPoint gp2; public DirectionPathOverlay(GeoPoint gp1, GeoPoint gp2) { this.gp1 = gp1; this.gp2 = gp2; } @Override public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) { Projection projection = mapView.getProjection(); if(shadow == false) { Paint paint = new Paint(); paint.setAntiAlias(true); Point point = new Point(); projection.toPixels(gp1, point); paint.setColor(Color.BLUE); Point point2 = new Point(); projection.toPixels(gp2, point2); paint.setStrokeWidth(2); canvas.drawLine((float) point.x, (float) point.y, (float) point2.x, (float) point2.y, paint); } return super.draw(canvas, mapView, shadow, when); } @Override public void draw(Canvas canvas, MapView mapView, boolean shadow) { super.draw(canvas, mapView, shadow); } }
主类
package com.android.antkingwei.google.direction; import java.net.HttpURLConnection; import java.net.URL; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import com.google.android.maps.GeoPoint; import com.google.android.maps.MapActivity; import com.google.android.maps.MapController; import com.google.android.maps.MapView; import android.app.Activity; import android.os.Bundle; import android.util.Log; public class MainActivity extends MapActivity { private MapView myMapView; private GeoPoint geoPoint; private MapController myMC; private String[] pairs; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); myMapView = (MapView) findViewById(R.id.mapview); geoPoint = null; myMapView.setSatellite(false); //通过地名 //pairs = getDirectionData("ahmedabad", "vadodara"); //通过四个坐标 pairs = getUrl(/blog_article/22.5348,113.97246,35.422006,119.524095); String[] lngLat = pairs[0].split(","); // STARTING POINT GeoPoint startGP = new GeoPoint((int)(Double.parseDouble(lngLat[1]) * 1E6), (int) (Double.parseDouble(lngLat[0]) * 1E6)); myMC = myMapView.getController(); geoPoint = startGP; myMC.setCenter(geoPoint); myMC.setZoom(8); myMapView.getOverlays().add(new DirectionPathOverlay(startGP, startGP)); // NAVIGATE THE PATH GeoPoint gp1; GeoPoint gp2 = startGP; for (int i = 1; i < pairs.length; i++) { lngLat = pairs[i].split(","); gp1 = gp2; // watch out! For GeoPoint, first:latitude, second:longitude gp2 = new GeoPoint((int) (Double.parseDouble(lngLat[1]) * 1E6),(int) (Double.parseDouble(lngLat[0]) * 1E6)); myMapView.getOverlays().add(new DirectionPathOverlay(gp1, gp2)); Log.d("xxx", "pair:" + pairs[i]); } // END POINT myMapView.getOverlays().add(new DirectionPathOverlay(gp2, gp2)); myMapView.getController().animateTo(startGP); myMapView.setBuiltInZoomControls(true); myMapView.displayZoomControls(true); } @Override protected boolean isRouteDisplayed() { // TODO Auto-generated method stub return false; } /** * 通过四个坐标点,获得KML然后通过DOM解析 * @param fromLat * @param fromLon * @param toLat * @param toLon * @return */ public String[] getUrl(/blog_article/double fromLat,double fromLon,double toLat,double toLon/index.html){ String urlString = "http://maps.google.com/maps?f=d&hl=en&saddr="+fromLat+","+fromLon+"&daddr="+toLat+","+toLon+"&ie=UTF8&0&om=0&output=kml"; Log.d("URL", urlString); Document doc = null; HttpURLConnection urlConnection = null; URL url = null; String pathConent = ""; try{ url = new URL(urlString.toString()); urlConnection = (HttpURLConnection) url.openConnection(); urlConnection.setRequestMethod("GET"); urlConnection.setDoOutput(true); urlConnection.setDoInput(true); urlConnection.connect(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); doc = db.parse(urlConnection.getInputStream()); } catch (Exception e){} NodeList nl = doc.getElementsByTagName("LineString"); for(int s=0; s< nl.getLength(); s++){ Node rootNode = nl.item(s); NodeList configItems = rootNode.getChildNodes(); for(int x=0; x < configItems.getLength(); x++) { Node lineStringNode = configItems.item(x); NodeList path = lineStringNode.getChildNodes(); pathConent = path.item(0).getNodeValue(); } } String[] tempContent = pathConent.split(" "); return tempContent; } /** * 通过连个地名获得KML然后进行DOM解析 * @param srcPlace * @param destPlace * @return */ private String[] getDirectionData(String srcPlace, String destPlace) { String urlString = "http://maps.google.com/maps?f=d&hl=en&saddr="+srcPlace+"&daddr="+destPlace+"&ie=UTF&om=0&output=kml"; Log.d("URL", urlString); Document doc = null; HttpURLConnection urlConnection = null; URL url = null; String pathConent = ""; try{ url = new URL(urlString.toString()); urlConnection = (HttpURLConnection) url.openConnection(); urlConnection.setRequestMethod("GET"); urlConnection.setDoOutput(true); urlConnection.setDoInput(true); urlConnection.connect(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); doc = db.parse(urlConnection.getInputStream()); } catch (Exception e){} NodeList nl = doc.getElementsByTagName("LineString"); for(int s=0; s< nl.getLength(); s++){ Node rootNode = nl.item(s); NodeList configItems = rootNode.getChildNodes(); for(int x=0; x < configItems.getLength(); x++) { Node lineStringNode = configItems.item(x); NodeList path = lineStringNode.getChildNodes(); pathConent = path.item(0).getNodeValue(); } } String[] tempContent = pathConent.split(" "); return tempContent; } }
最新技术文章: