Wednesday, February 5, 2014

Api to achieve real-time bus


            
Xiangnong a real-time bus arrival query software, but how we can get the bus to official data, the online software applications that transit is how to obtain the official data, is not an official bus interface, or a corresponding api documentation ? ? ?


Hope insiders let us know ....
Reply:
You can use Baidu map api, is free
Reply:
Baidu api including mobile development and web development, good use
http://developer.baidu.com/map/
Reply:
reference to the second floor kouwoo reply:
Baidu api including mobile development and web development, good use
http://developer.baidu.com/map/


You can get real-time bus arrival information? ? ?
Reply:
reference to the third floor q745401990 reply:
Quote: references to the second floor kouwoo reply:

Baidu api including mobile development and web development, good use
http://developer.baidu.com/map/


You can get real-time bus arrival information? ? ?


Support for bus information, bus transfer inquiry, driving route planning and walking route search.

Bus information: For more information on public transportation can be queried;
Bus Ride query: According since the end of the query strategy, route planning program;
Driving route planning: providing different strategies, planning driving routes; (supports setting waypoints)
Walking route search: Support planning walking paths.
Reply:
references, 4th Floor kouwoo reply:
Quote: references to the third floor q745401990 reply:

Quote: 2nd Floor reply kouwoo of references:

Baidu api including mobile development and web development, good use
http://developer.baidu.com/map/


You can get real-time bus arrival information? ? ?


Support for bus information, bus transfer inquiry, driving route planning and walking route search.

Bus information: For more information on public transportation can be queried;
Bus Ride query: According since the end of the query strategy, route planning program;
Driving route planning: providing different strategies, planning driving routes; (supports setting waypoints)
Walking route search: Support planning walking paths.


You can know the exact location of a real-time, a bus, the distance from the site, such as short of a few stops?
Reply:
references, 5th Floor q745401990 reply:
Quote: references to the 4th floor kouwoo reply:

Quote: references to the third floor q745401990 reply:

Quote: 2nd Floor reply kouwoo of references:

Baidu api including mobile development and web development, good use
http://developer.baidu.com/map/


You can get real-time bus arrival information? ? ?


Support for bus information, bus transfer inquiry, driving route planning and walking route search.

Bus information: For more information on public transportation can be queried;
Bus Ride query: According since the end of the query strategy, route planning program;
Driving route planning: providing different strategies, planning driving routes; (supports setting waypoints)
Walking route search: Support planning walking paths.


You can know the exact location of a real-time, a bus, the distance from the site, such as short of a few stops?



The specific location of the bus can be queried through Baidu map api, but the distance from the site, such as a few stops short of the necessary logic to write their own algorithms, and should not provide such api
Reply:
Such products have been available in the market, such "Rainbow Bus" is used to do figure it out maps api
Reply:
Real-time interface to the station will not open, you can go to tender, purchase
Reply:
Decompiled code yourself, your own research
Reply:
  
android: layout_width = "fill_parent"
android: layout_height = "fill_parent"
android: orientation = "vertical">

android: id = "@ + id / lltBtnplan"
android: layout_width = "fill_parent"
android: layout_height = "wrap_content"
android: orientation = "vertical">

android: id = "@ + id/txtTransit0"
android: layout_width = "fill_parent"
android: layout_height = "@ dimen/S40dip"
android: layout_margin = "@ dimen/S3dip"
android: hint = "@ string / placeDeparture" />

android: id = "@ + id/txtTransit1"
android: layout_width = "fill_parent"
android: layout_height = "@ dimen/S40dip"
android: layout_margin = "@ dimen/S3dip"
android: hint = "@ string / termini" />

android: layout_width = "fill_parent"
android: layout_height = "wrap_content"
android: gravity = "center_horizontal"
android: orientation = "horizontal">


 package com.taocaiku.gaea.activity.test; 

import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;
import com.baidu.platform.comapi.basestruct.GeoPoint;
import com.taocaiku.gaea.R;
import com.taocaiku.gaea.activity.pilot.MoreAct;
import com.taocaiku.gaea.common.activity.PilotMapActivity;
import com.taocaiku.gaea.domain.Domain;

/ **
* Query bus
* @ Author TCK-001
* @ Version 1.0
* /
public class TransitAct extends PilotMapActivity {

private EditText txtData0, txtData1;

@ Override
protected void onCreate (Bundle bundle) {
super.onCreate (bundle); setContentView (R.layout.test_transit);. app () addActivity (this);
txtData0 = findView (R.id.txtTransit0);
txtData1 = findView (R.id.txtTransit1);
. findViewById (R.id.btnMyPoint) setOnClickListener (getMyPoint ());
. findViewById (R.id.btnDist) setOnClickListener (getDist ());
. findViewById (R.id.btnPlanPath) setOnClickListener (getTransit ());
setMustView (R.id.lltTransitGress, R.id.lltBtnplan, R.id.btnPre, R.id.btnNext, R.id.mvwTransitMap);
mapUtil.searchAddr (pointUtil.getMyPoint (), "myPointBack", gressLayout);
}

private OnClickListener getMyPoint () {
return new OnClickListener () {
public void onClick (View view) {
mapUtil.searchAddr (pointUtil.getMyPoint (), "myPointBack", gressLayout);
}
};
}

public void myPointBack () {
myProvince = mapUtil.getComponent () province;.
myCity = mapUtil.getComponent () city;.
txtData0.setText (mapUtil.getComponent () street + mapUtil.getComponent () streetNumber..);
}

private OnClickListener getDist () {
return new OnClickListener () {
public void onClick (View view) {
if (notNull (getText (txtData0), "departure", true) && notNull (getText (txtData1), "destination", true)) {
mapUtil.searchPoint (myProvince + myCity, getText (txtData0), "getDist1", gressLayout);
}
}
};
}

public void getDist1 () {
beginPoint = mapUtil.getAddrPoint ();
if (beginPoint [0]> 0d && beginPoint [1]> 0d) {
mapUtil.searchPoint (myProvince + myCity, getText (txtData1), "getDist2", gressLayout);
} Else {
prompt ("From the address is incomplete, path planning failed");
}
}

public void getDist2 () {
targetPoint = mapUtil.getAddrPoint ();
if (targetPoint [0]> 0d && targetPoint [1]> 0d) {
GeoPoint [] points = new GeoPoint [] {mapUtil.getGeo (beginPoint), mapUtil.getGeo (targetPoint)};
Drawable [] drawables = new Drawable [] {. GetResources () getDrawable (R.drawable.icon_marke), getResources () getDrawable (R.drawable.icon_markf).};
mapUtil.setPoints (points, new String [] {"departure", "destination"}, drawables);
alert (R.drawable.info, ((int) mapUtil.getDistance (beginPoint, targetPoint) + 1) + "m", "");
} Else {
prompt ("destination address was incomplete, path planning failed");
}
}

private OnClickListener getTransit () {
return new OnClickListener () {
public void onClick (View view) {
if (notNull (getText (txtData0), "departure", true) && notNull (getText (txtData1), "destination", true)) {
mapUtil.searchPoint (myProvince + myCity, getText (txtData0), "getTransit1", gressLayout);
}
}
};
}

public void getTransit1 () {
beginPoint = mapUtil.getAddrPoint ();
if (beginPoint [0]> 0d && beginPoint [1]> 0d) {
mapUtil.searchPoint (myProvince + myCity, getText (txtData1), "getTransit2", gressLayout);
} Else {
prompt ("From the address is incomplete, path planning failed");
}
}

public void getTransit2 () {
targetPoint = mapUtil.getAddrPoint ();
if (targetPoint [0]> 0d && targetPoint [1]> 0d) {
mapUtil.planPath (beginPoint, targetPoint, myCity, 2, "planPathBack", gressLayout);
} Else {
prompt ("destination address was incomplete, path planning failed");
}
}

@ Override
public void toBack (View view) {
changeAct (MoreAct.class, null, Domain.RIGHT);
}

}

Reply:
reference to the 10th floor s478853630 reply:
  
android: layout_width = "fill_parent"
android: layout_height = "fill_parent"
android: orientation = "vertical">

android: id = "@ + id / lltBtnplan"
android: layout_width = "fill_parent"
android: layout_height = "wrap_content"
android: orientation = "vertical">

android: id = "@ + id/txtTransit0"
android: layout_width = "fill_parent"
android: layout_height = "@ dimen/S40dip"
android: layout_margin = "@ dimen/S3dip"
android: hint = "@ string / placeDeparture" />

android: id = "@ + id/txtTransit1"
android: layout_width = "fill_parent"
android: layout_height = "@ dimen/S40dip"
android: layout_margin = "@ dimen/S3dip"
android: hint = "@ string / termini" />

android: layout_width = "fill_parent"
android: layout_height = "wrap_content"
android: gravity = "center_horizontal"
android: orientation = "horizontal">


 package com.taocaiku.gaea.activity.test; 

import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;
import com.baidu.platform.comapi.basestruct.GeoPoint;
import com.taocaiku.gaea.R;
import com.taocaiku.gaea.activity.pilot.MoreAct;
import com.taocaiku.gaea.common.activity.PilotMapActivity;
import com.taocaiku.gaea.domain.Domain;

/ **
* Query bus
* @ Author TCK-001
* @ Version 1.0
* /
public class TransitAct extends PilotMapActivity {

private EditText txtData0, txtData1;

@ Override
protected void onCreate (Bundle bundle) {
super.onCreate (bundle); setContentView (R.layout.test_transit);. app () addActivity (this);
txtData0 = findView (R.id.txtTransit0);
txtData1 = findView (R.id.txtTransit1);
. findViewById (R.id.btnMyPoint) setOnClickListener (getMyPoint ());
. findViewById (R.id.btnDist) setOnClickListener (getDist ());
. findViewById (R.id.btnPlanPath) setOnClickListener (getTransit ());
setMustView (R.id.lltTransitGress, R.id.lltBtnplan, R.id.btnPre, R.id.btnNext, R.id.mvwTransitMap);
mapUtil.searchAddr (pointUtil.getMyPoint (), "myPointBack", gressLayout);
}

private OnClickListener getMyPoint () {
return new OnClickListener () {
public void onClick (View view) {
mapUtil.searchAddr (pointUtil.getMyPoint (), "myPointBack", gressLayout);
}
};
}

public void myPointBack () {
myProvince = mapUtil.getComponent () province;.
myCity = mapUtil.getComponent () city;.
txtData0.setText (mapUtil.getComponent () street + mapUtil.getComponent () streetNumber..);
}

private OnClickListener getDist () {
return new OnClickListener () {
public void onClick (View view) {
if (notNull (getText (txtData0), "departure", true) && notNull (getText (txtData1), "destination", true)) {
mapUtil.searchPoint (myProvince + myCity, getText (txtData0), "getDist1", gressLayout);
}
}
};
}

public void getDist1 () {
beginPoint = mapUtil.getAddrPoint ();
if (beginPoint [0]> 0d && beginPoint [1]> 0d) {
mapUtil.searchPoint (myProvince + myCity, getText (txtData1), "getDist2", gressLayout);
} Else {
prompt ("From the address is incomplete, path planning failed");
}
}

public void getDist2 () {
targetPoint = mapUtil.getAddrPoint ();
if (targetPoint [0]> 0d && targetPoint [1]> 0d) {
GeoPoint [] points = new GeoPoint [] {mapUtil.getGeo (beginPoint), mapUtil.getGeo (targetPoint)};
Drawable [] drawables = new Drawable [] {. GetResources () getDrawable (R.drawable.icon_marke), getResources () getDrawable (R.drawable.icon_markf).};
mapUtil.setPoints (points, new String [] {"departure", "destination"}, drawables);
alert (R.drawable.info, ((int) mapUtil.getDistance (beginPoint, targetPoint) + 1) + "m", "");
} Else {
prompt ("destination address was incomplete, path planning failed");
}
}

private OnClickListener getTransit () {
return new OnClickListener () {
public void onClick (View view) {
if (notNull (getText (txtData0), "departure", true) && notNull (getText (txtData1), "destination", true)) {
mapUtil.searchPoint (myProvince + myCity, getText (txtData0), "getTransit1", gressLayout);
}
}
};
}

public void getTransit1 () {
beginPoint = mapUtil.getAddrPoint ();
if (beginPoint [0]> 0d && beginPoint [1]> 0d) {
mapUtil.searchPoint (myProvince + myCity, getText (txtData1), "getTransit2", gressLayout);
} Else {
prompt ("From the address is incomplete, path planning failed");
}
}

public void getTransit2 () {
targetPoint = mapUtil.getAddrPoint ();
if (targetPoint [0]> 0d && targetPoint [1]> 0d) {
mapUtil.planPath (beginPoint, targetPoint, myCity, 2, "planPathBack", gressLayout);
} Else {
prompt ("destination address was incomplete, path planning failed");
}
}

@ Override
public void toBack (View view) {
changeAct (MoreAct.class, null, Domain.RIGHT);
}

}


Also add any extra jar package? Can hair a little longer
Reply:
This is an internal interface, not easily open.
Reply:
reference to the 12th floor shaojieli reply:
This is an internal interface, not easily open.


..... Get real-time location of buses in a line ah

Reply:
You think about the principle, or network location through GPS positioning obtained, after you get the need to be preserved in order to use it, save the place from between your application, it will certainly have to have a path, this path will need someone to achieve, that is, after the package features provided by the external API. Only through this way, you can use it.
Reply:
reference to the 14th floor shaojieli reply:
you think about the principle, the location via GPS or network positioning is obtained, after you get the need to be preserved in order to use it, From a place to save between your application, it will certainly have to have a path, this path would need someone to realize, that is, after the package features provided by the external API. Only through this way, you can use it.



I know the truth, but how to get your GPS location and get tangled on the API issues ....

No comments:

Post a Comment