Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2022-020
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2022-020
2022-020
Commits
689ae5f7
Commit
689ae5f7
authored
Oct 09, 2022
by
A.P.R.C. Abeyrathna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Accuracy Update V1
parent
b57a6bc9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
90 additions
and
9 deletions
+90
-9
.idea/jarRepositories.xml
.idea/jarRepositories.xml
+25
-0
app/build.gradle
app/build.gradle
+17
-2
app/src/main/java/com/app/travelle/RetrieveBusMap.java
app/src/main/java/com/app/travelle/RetrieveBusMap.java
+28
-5
build.gradle
build.gradle
+20
-2
No files found.
.idea/jarRepositories.xml
0 → 100644
View file @
689ae5f7
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"RemoteRepositoriesConfiguration"
>
<remote-repository>
<option
name=
"id"
value=
"central"
/>
<option
name=
"name"
value=
"Maven Central repository"
/>
<option
name=
"url"
value=
"https://repo1.maven.org/maven2"
/>
</remote-repository>
<remote-repository>
<option
name=
"id"
value=
"jboss.community"
/>
<option
name=
"name"
value=
"JBoss Community repository"
/>
<option
name=
"url"
value=
"https://repository.jboss.org/nexus/content/repositories/public/"
/>
</remote-repository>
<remote-repository>
<option
name=
"id"
value=
"MavenRepo"
/>
<option
name=
"name"
value=
"MavenRepo"
/>
<option
name=
"url"
value=
"https://repo.maven.apache.org/maven2/"
/>
</remote-repository>
<remote-repository>
<option
name=
"id"
value=
"Google"
/>
<option
name=
"name"
value=
"Google"
/>
<option
name=
"url"
value=
"https://dl.google.com/dl/android/maven2/"
/>
</remote-repository>
</component>
</project>
\ No newline at end of file
app/build.gradle
View file @
689ae5f7
...
@@ -43,8 +43,23 @@ dependencies {
...
@@ -43,8 +43,23 @@ dependencies {
implementation
'com.google.android.gms:play-services-maps:18.1.0'
implementation
'com.google.android.gms:play-services-maps:18.1.0'
implementation
'com.google.android.gms:play-services-maps:18.1.0'
implementation
'com.google.android.gms:play-services-maps:18.1.0'
implementation
'com.google.android.gms:play-services-location:20.0.0'
implementation
'com.google.android.gms:play-services-location:20.0.0'
implementation
'com.google.firebase:firebase-database:20.0.
4
'
implementation
'com.google.firebase:firebase-database:20.0.
6
'
testImplementation
'junit:junit:4.13.2'
testImplementation
'junit:junit:4.13.2'
androidTestImplementation
'androidx.test.ext:junit:1.1.3'
androidTestImplementation
'androidx.test.ext:junit:1.1.3'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.4.0'
}
// Import the BoM for the Firebase platform
\ No newline at end of file
implementation
platform
(
'com.google.firebase:firebase-bom:30.5.0'
)
// Add the dependency for the Realtime Database library
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation
'com.google.firebase:firebase-database'
// Import the BoM for the Firebase platform
implementation
platform
(
'com.google.firebase:firebase-bom:30.5.0'
)
// Declare the dependencies for the desired Firebase products without specifying versions
// For example, declare the dependencies for Firebase Authentication and Cloud Firestore
implementation
'com.google.firebase:firebase-auth'
implementation
'com.google.firebase:firebase-firestore'
}
app/src/main/java/com/app/travelle/RetrieveBusMap.java
View file @
689ae5f7
...
@@ -3,7 +3,9 @@ package com.app.travelle;
...
@@ -3,7 +3,9 @@ package com.app.travelle;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
androidx.fragment.app.FragmentActivity
;
import
androidx.fragment.app.FragmentActivity
;
import
android.content.res.Resources
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.util.Log
;
import
android.view.Window
;
import
android.view.Window
;
import
android.view.WindowManager
;
import
android.view.WindowManager
;
...
@@ -12,6 +14,7 @@ import com.google.android.gms.maps.GoogleMap;
...
@@ -12,6 +14,7 @@ import com.google.android.gms.maps.GoogleMap;
import
com.google.android.gms.maps.OnMapReadyCallback
;
import
com.google.android.gms.maps.OnMapReadyCallback
;
import
com.google.android.gms.maps.SupportMapFragment
;
import
com.google.android.gms.maps.SupportMapFragment
;
import
com.google.android.gms.maps.model.LatLng
;
import
com.google.android.gms.maps.model.LatLng
;
import
com.google.android.gms.maps.model.MapStyleOptions
;
import
com.google.android.gms.maps.model.MarkerOptions
;
import
com.google.android.gms.maps.model.MarkerOptions
;
import
com.app.travelle.databinding.ActivityRetrieveBusMapBinding
;
import
com.app.travelle.databinding.ActivityRetrieveBusMapBinding
;
import
com.google.firebase.database.DataSnapshot
;
import
com.google.firebase.database.DataSnapshot
;
...
@@ -29,6 +32,7 @@ public class RetrieveBusMap extends FragmentActivity implements OnMapReadyCallba
...
@@ -29,6 +32,7 @@ public class RetrieveBusMap extends FragmentActivity implements OnMapReadyCallba
@Override
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
System
.
out
.
println
(
"Started"
);
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
requestWindowFeature
(
Window
.
FEATURE_NO_TITLE
);
requestWindowFeature
(
Window
.
FEATURE_NO_TITLE
);
this
.
getWindow
().
setFlags
(
WindowManager
.
LayoutParams
.
FLAG_FULLSCREEN
,
WindowManager
.
LayoutParams
.
FLAG_FULLSCREEN
);
this
.
getWindow
().
setFlags
(
WindowManager
.
LayoutParams
.
FLAG_FULLSCREEN
,
WindowManager
.
LayoutParams
.
FLAG_FULLSCREEN
);
...
@@ -55,18 +59,37 @@ public class RetrieveBusMap extends FragmentActivity implements OnMapReadyCallba
...
@@ -55,18 +59,37 @@ public class RetrieveBusMap extends FragmentActivity implements OnMapReadyCallba
mMap
=
googleMap
;
mMap
=
googleMap
;
DatabaseReference
databaseReference
=
FirebaseDatabase
.
getInstance
().
getReference
(
"/"
);
DatabaseReference
databaseReference
=
FirebaseDatabase
.
getInstance
().
getReference
(
"/"
);
System
.
out
.
println
(
"================================================"
)
;
System
.
out
.
println
(
databaseReference
);
//Styling
try
{
// Customise the styling of the base map using a JSON object defined
// in a raw resource file.
boolean
success
=
googleMap
.
setMapStyle
(
MapStyleOptions
.
loadRawResourceStyle
(
this
,
R
.
raw
.
map_style
));
if
(!
success
)
{
Log
.
e
(
"HomeMap"
,
"Style parsing failed."
);
}
}
catch
(
Resources
.
NotFoundException
e
)
{
Log
.
e
(
"HomeMap"
,
"Can't find style. Error: "
,
e
);
}
ValueEventListener
listener
=
databaseReference
.
addValueEventListener
(
new
ValueEventListener
()
{
ValueEventListener
listener
=
databaseReference
.
addValueEventListener
(
new
ValueEventListener
()
{
@Override
@Override
public
void
onDataChange
(
@NonNull
DataSnapshot
dataSnapshot
)
{
public
void
onDataChange
(
@NonNull
DataSnapshot
dataSnapshot
)
{
Double
latitude
=
dataSnapshot
.
child
(
"latitude"
).
getValue
(
Double
.
class
);
System
.
out
.
println
(
"changing-----------------------------"
);
Double
longitude
=
dataSnapshot
.
child
(
"longitude"
).
getValue
(
Double
.
class
);
String
latitude
=
dataSnapshot
.
child
(
"latitude"
).
getValue
(
String
.
class
);
String
longitude
=
dataSnapshot
.
child
(
"longitude"
).
getValue
(
String
.
class
);
LatLng
location
=
new
LatLng
(
latitude
,
longitude
);
System
.
out
.
println
(
latitude
+
longitude
);
LatLng
location
=
new
LatLng
(
Double
.
parseDouble
(
latitude
),
Double
.
parseDouble
(
longitude
));
mMap
.
addMarker
(
new
MarkerOptions
().
position
(
location
).
title
(
"117"
));
mMap
.
addMarker
(
new
MarkerOptions
().
position
(
location
).
title
(
"117"
));
mMap
.
moveCamera
(
CameraUpdateFactory
.
newLatLngZoom
(
location
,
14
F
));
mMap
.
moveCamera
(
CameraUpdateFactory
.
newLatLngZoom
(
location
,
17
));
}
}
...
...
build.gradle
View file @
689ae5f7
buildscript
{
buildscript
{
repositories
{
// Make sure that you have the following two repositories
}
dependencies
{
dependencies
{
classpath
'com.google.gms:google-services:4.3.10'
classpath
'com.google.gms:google-services:4.3.14'
}
}
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins
{
plugins
{
id
'com.android.application'
version
'7.3.0'
apply
false
id
'com.android.application'
version
'7.3.0'
apply
false
id
'com.android.library'
version
'7.3.0'
apply
false
id
'com.android.library'
version
'7.3.0'
apply
false
id
'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
version
'2.0.1'
apply
false
id
'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
version
'2.0.1'
apply
false
}
}
\ No newline at end of file
allprojects
{
repositories
{
// Make sure that you have the following two repositories
}}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment