-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
110 changed files
with
2,347 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/caches | ||
/.idea/libraries | ||
/.idea/modules.xml | ||
/.idea/workspace.xml | ||
/.idea/navEditor.xml | ||
/.idea/assetWizardSettings.xml | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 28 | ||
defaultConfig { | ||
applicationId "com.example.apicollaboration" | ||
minSdkVersion 15 | ||
targetSdkVersion 28 | ||
versionCode 1 | ||
versionName "1.0" | ||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation fileTree(include: ['*.jar'], dir: 'libs') | ||
implementation 'com.android.support:appcompat-v7:28.0.0' | ||
implementation 'com.android.support.constraint:constraint-layout:1.1.3' | ||
implementation 'com.android.support:design:28.0.0' | ||
testImplementation 'junit:junit:4.12' | ||
androidTestImplementation 'com.android.support.test:runner:1.0.2' | ||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' | ||
implementation files('libs/com.skt.Tmap_1.60.jar') | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
26 changes: 26 additions & 0 deletions
26
...ombine/app/src/androidTest/java/com/example/apicollaboration/ExampleInstrumentedTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.example.apicollaboration; | ||
|
||
import android.content.Context; | ||
import android.support.test.InstrumentationRegistry; | ||
import android.support.test.runner.AndroidJUnit4; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | ||
*/ | ||
@RunWith(AndroidJUnit4.class) | ||
public class ExampleInstrumentedTest { | ||
@Test | ||
public void useAppContext() { | ||
// Context of the app under test. | ||
Context appContext = InstrumentationRegistry.getTargetContext(); | ||
|
||
assertEquals("com.example.apicollaboration", appContext.getPackageName()); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
Xml과 코드합치기 파일/2_10Combine/app/src/main/AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.example.apicollaboration"> | ||
|
||
<uses-permission android:name="android.permission.INTERNET"/> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme.NoActionBar"> | ||
<activity android:name=".Activity.AddressMarkActivity"/> | ||
<activity | ||
android:name=".Activity.ListViewActivity" | ||
android:label="@string/title_activity_list_view" | ||
android:theme="@style/AppTheme.NoActionBar"/> | ||
<activity android:name=".Activity.MainActivity"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN"/> | ||
|
||
<category android:name="android.intent.category.LAUNCHER"/> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
162 changes: 162 additions & 0 deletions
162
...0Combine/app/src/main/java/com/example/apicollaboration/Activity/AddressMarkActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
package com.example.apicollaboration.Activity; | ||
|
||
import android.content.Intent; | ||
import android.graphics.Bitmap; | ||
import android.graphics.BitmapFactory; | ||
import android.graphics.Color; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.os.Bundle; | ||
import android.view.View; | ||
import android.widget.Button; | ||
import android.widget.LinearLayout; | ||
import android.widget.TextView; | ||
|
||
import static com.example.apicollaboration.ArraySavingClass.array_saving_class.alTMapPoint; | ||
|
||
import com.example.apicollaboration.ArraySavingClass.array_saving_class; | ||
import com.example.apicollaboration.R; | ||
import com.skt.Tmap.TMapData; | ||
import com.skt.Tmap.TMapMarkerItem; | ||
import com.skt.Tmap.TMapPoint; | ||
import com.skt.Tmap.TMapPolyLine; | ||
import com.skt.Tmap.TMapView; | ||
|
||
public class AddressMarkActivity extends AppCompatActivity { | ||
TMapView tMapView; | ||
TextView address_textView; | ||
TextView name_textView; | ||
Button yesBtn; | ||
Button noBtn; | ||
Bitmap bitmap; | ||
Bitmap temp; | ||
TMapPoint centerP; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
|
||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_address_mark_acitvity); | ||
LinearLayout linearLayoutTmap = (LinearLayout) findViewById(R.id.mapview); | ||
tMapView = new TMapView(this); | ||
name_textView = (TextView) findViewById(R.id.nameOfLocation); | ||
address_textView = (TextView) findViewById(R.id.nameOfAddress); | ||
|
||
linearLayoutTmap.addView(tMapView); | ||
|
||
bitmap = BitmapFactory.decodeResource(this.getResources(), R.drawable.group6); | ||
|
||
temp = BitmapFactory.decodeResource(this.getResources(), R.drawable.group6); | ||
|
||
markReturn(); | ||
|
||
|
||
if (array_saving_class.centerOfIt == false) { | ||
address_textView.setText(array_saving_class.addressOfIt.get(array_saving_class.addressOfIt.size() - 1)); | ||
name_textView.setText(array_saving_class.nameOfIt.get(array_saving_class.nameOfIt.size() - 1)); | ||
|
||
tMapView.setCenterPoint(alTMapPoint.get(alTMapPoint.size() - 1).getLongitude(), alTMapPoint.get(alTMapPoint.size() - 1).getLatitude()); | ||
|
||
} | ||
else{ | ||
// getLatitude랑 getLongitude부분이 반대로 적혀있음. 수정해야함. | ||
tMapView.setCenterPoint(array_saving_class.center_point.getLatitude(), array_saving_class.center_point.getLongitude()); | ||
|
||
TMapMarkerItem center = new TMapMarkerItem(); | ||
centerP = new TMapPoint(array_saving_class.center_point.getLongitude(), array_saving_class.center_point.getLatitude()); | ||
|
||
center.setIcon(bitmap); // 마커 아이콘 지정 | ||
center.setCanShowCallout(true); // 풍선뷰의 사용여부를 설정한다. | ||
center.setCalloutSubTitle("중간지점 입니다."); // 풍선뷰 보조메시지 설정 | ||
center.setCalloutTitle("중간지점 "); // 풍선뷰 제목 설정 | ||
center.setCalloutRightButtonImage(temp); // 풍선뷰 오른쪽 이미지 설정 | ||
center.setAutoCalloutVisible(true); // 풍선뷰 자동 활성화 | ||
|
||
// 마커의 좌표 지정 | ||
center.setTMapPoint(centerP); // 마커 위,경도 설정 | ||
center.setVisible(TMapMarkerItem.VISIBLE); // 아이콘 보이게 | ||
//지도에 마커 추가 | ||
tMapView.addMarkerItem("markerItem", center); | ||
|
||
// 중간지점에 자동차경로 추가 | ||
drawline(); | ||
|
||
} | ||
|
||
yesBtn = (Button) findViewById(R.id.yesBtn); | ||
//noBtn = (Button) findViewById(R.id.noBtn); | ||
|
||
yesBtn.setOnClickListener(new Button.OnClickListener() { | ||
@Override | ||
public void onClick(View view) { | ||
array_saving_class.final_location.add(array_saving_class.nameOfIt.get(array_saving_class.addressOfIt.size() - 1)); | ||
array_saving_class.final_Point.add(new TMapPoint(alTMapPoint.get(alTMapPoint.size() - 1).getLongitude(), alTMapPoint.get(alTMapPoint.size() - 1).getLatitude())); | ||
Intent goToMain = new Intent(getApplicationContext(), MainActivity.class); | ||
startActivity(goToMain); | ||
} | ||
}); | ||
|
||
noBtn.setOnClickListener(new Button.OnClickListener() { | ||
@Override | ||
public void onClick(View view) { | ||
array_saving_class.addressOfIt.remove(array_saving_class.addressOfIt.get(array_saving_class.addressOfIt.size() - 1)); | ||
alTMapPoint.remove(alTMapPoint.get(alTMapPoint.size() - 1)); | ||
Intent goToMain = new Intent(getApplicationContext(), MainActivity.class); | ||
startActivity(goToMain); | ||
} | ||
}); | ||
// 중간지점 체크 후 테스트를 위해 yes no 버튼을 빼놨습니다. 수정해야합니다. | ||
|
||
} | ||
|
||
// 자동차 경로 호출시 외부에서 Thread를 통해서 호출해줘야 정상적으로 실행 | ||
|
||
public void drawline() { | ||
|
||
new Thread(new Runnable() { | ||
@Override public void run() { | ||
try { | ||
for(int i=0; i< alTMapPoint.size(); i++) { | ||
|
||
TMapPolyLine tMapPolyLine = new TMapData().findPathData(alTMapPoint.get(i), centerP); | ||
tMapPolyLine.setLineColor(Color.BLUE); | ||
tMapPolyLine.setLineWidth(2); | ||
tMapView.addTMapPolyLine("Line1" + i, tMapPolyLine); | ||
|
||
} | ||
|
||
}catch(Exception e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
}).start(); | ||
|
||
} | ||
|
||
public void markReturn() { | ||
|
||
for (int i = 0; i < alTMapPoint.size(); i++) { | ||
|
||
TMapMarkerItem markerItem1 = new TMapMarkerItem(); | ||
// 마커 아이콘 지정 | ||
markerItem1.setIcon(bitmap); | ||
markerItem1.setCanShowCallout(true); | ||
markerItem1.setCalloutSubTitle("위치:" + array_saving_class.nameOfIt.get(array_saving_class.nameOfIt.size() - 1)); // 위치 자동으로 찍히게 수정해야함 | ||
markerItem1.setCalloutTitle("좌표 " + Integer.toString(i + 1) + "번"); | ||
markerItem1.setCalloutRightButtonImage(temp); | ||
|
||
markerItem1.setAutoCalloutVisible(true); | ||
// 마커의 좌표 지정 | ||
markerItem1.setTMapPoint(alTMapPoint.get(i)); | ||
//지도에 마커 추가 | ||
tMapView.addMarkerItem("markerItem" + i, markerItem1); | ||
tMapView.setCenterPoint(alTMapPoint.get(i).getLatitude(), alTMapPoint.get(i).getLatitude()); | ||
|
||
} | ||
} | ||
|
||
@Override | ||
public void onBackPressed() { | ||
Intent backMainIntent = new Intent(getApplicationContext(), MainActivity.class); | ||
startActivity(backMainIntent); | ||
} | ||
} |
Oops, something went wrong.