Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-194
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
2021–194
2021-194
Commits
9f0851ed
Commit
9f0851ed
authored
Oct 17, 2021
by
Anupama Balasooriya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Give location prmission from manifest file
parent
cb2d4359
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
96 additions
and
3 deletions
+96
-3
.idea/compiler.xml
.idea/compiler.xml
+1
-1
.idea/misc.xml
.idea/misc.xml
+2
-2
.idea/modules.xml
.idea/modules.xml
+9
-0
app/build.gradle
app/build.gradle
+3
-0
app/src/main/AndroidManifest.xml
app/src/main/AndroidManifest.xml
+9
-0
app/src/main/java/com/sliit/smartserviceassistant/spareparts/MapsActivity.java
.../sliit/smartserviceassistant/spareparts/MapsActivity.java
+51
-0
app/src/main/res/layout/activity_maps.xml
app/src/main/res/layout/activity_maps.xml
+11
-0
app/src/main/res/values/strings.xml
app/src/main/res/values/strings.xml
+10
-0
No files found.
.idea/compiler.xml
View file @
9f0851ed
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"CompilerConfiguration"
>
<bytecodeTargetLevel
target=
"1
1
"
/>
<bytecodeTargetLevel
target=
"1
.8
"
/>
</component>
</project>
\ No newline at end of file
.idea/misc.xml
View file @
9f0851ed
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1
1"
default=
"true
"
project-jdk-name=
"11"
project-jdk-type=
"JavaSDK"
>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1
_8
"
project-jdk-name=
"11"
project-jdk-type=
"JavaSDK"
>
<output
url=
"file://$PROJECT_DIR$/build/classes"
/>
</component>
<component
name=
"ProjectType"
>
<option
name=
"id"
value=
"Android"
/>
</component>
</project>
</project>
\ No newline at end of file
.idea/modules.xml
0 → 100644
View file @
9f0851ed
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ProjectModuleManager"
>
<modules>
<module
fileurl=
"file://$PROJECT_DIR$/.idea/modules/Smart_Service_Assistant.iml"
filepath=
"$PROJECT_DIR$/.idea/modules/Smart_Service_Assistant.iml"
/>
<module
fileurl=
"file://$PROJECT_DIR$/.idea/modules/app/Smart_Service_Assistant.app.iml"
filepath=
"$PROJECT_DIR$/.idea/modules/app/Smart_Service_Assistant.app.iml"
/>
</modules>
</component>
</project>
\ No newline at end of file
app/build.gradle
View file @
9f0851ed
...
...
@@ -20,6 +20,9 @@ android {
sourceCompatibility
JavaVersion
.
VERSION_1_8
targetCompatibility
JavaVersion
.
VERSION_1_8
}
buildFeatures
{
viewBinding
true
}
}
dependencies
{
...
...
app/src/main/AndroidManifest.xml
View file @
9f0851ed
...
...
@@ -8,9 +8,18 @@
location permissions for the "MyLocation" functionality.
-->
<uses-permission
android:name=
"android.permission.ACCESS_FINE_LOCATION"
/>
<<<<<<
< HEAD
<uses-permission
android:name=
"android.permission.MANAGE_ACCOUNTS"
/>
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
=======
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.ACCESS_WIFI_STATE"
/>
<uses-permission
android:name=
"android.permission.ACCESS_NETWORK_STATE"
/>
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"com.google.android.providers.gsf.permission.READ_GSERVICES"
/>
<uses-permission
android:name=
"android.permission.ACCESS_COARSE_LOCATION"
/>
>>>>>>> 7a12c31 (Create google maps activity)
<application
android:allowBackup=
"true"
...
...
app/src/main/java/com/sliit/smartserviceassistant/spareparts/MapsActivity.java
0 → 100644
View file @
9f0851ed
package
com.sliit.smartserviceassistant.spareparts
;
import
androidx.fragment.app.FragmentActivity
;
import
android.os.Bundle
;
import
com.google.android.gms.maps.CameraUpdateFactory
;
import
com.google.android.gms.maps.GoogleMap
;
import
com.google.android.gms.maps.OnMapReadyCallback
;
import
com.google.android.gms.maps.SupportMapFragment
;
import
com.google.android.gms.maps.model.LatLng
;
import
com.google.android.gms.maps.model.MarkerOptions
;
import
com.sliit.smartserviceassistant.spareparts.databinding.ActivityMapsBinding
;
public
class
MapsActivity
extends
FragmentActivity
implements
OnMapReadyCallback
{
private
GoogleMap
mMap
;
private
ActivityMapsBinding
binding
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
binding
=
ActivityMapsBinding
.
inflate
(
getLayoutInflater
());
setContentView
(
binding
.
getRoot
());
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
SupportMapFragment
mapFragment
=
(
SupportMapFragment
)
getSupportFragmentManager
()
.
findFragmentById
(
R
.
id
.
map
);
mapFragment
.
getMapAsync
(
this
);
}
/**
* Manipulates the map once available.
* This callback is triggered when the map is ready to be used.
* This is where we can add markers or lines, add listeners or move the camera. In this case,
* we just add a marker near Sydney, Australia.
* If Google Play services is not installed on the device, the user will be prompted to install
* it inside the SupportMapFragment. This method will only be triggered once the user has
* installed Google Play services and returned to the app.
*/
@Override
public
void
onMapReady
(
GoogleMap
googleMap
)
{
mMap
=
googleMap
;
// Add a marker in Sydney and move the camera
LatLng
sydney
=
new
LatLng
(-
34
,
151
);
mMap
.
addMarker
(
new
MarkerOptions
().
position
(
sydney
).
title
(
"Marker in Sydney"
));
mMap
.
moveCamera
(
CameraUpdateFactory
.
newLatLng
(
sydney
));
}
}
\ No newline at end of file
app/src/main/res/layout/activity_maps.xml
View file @
9f0851ed
<?xml version="1.0" encoding="utf-8"?>
<<<<<<
< HEAD
<FrameLayout
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
...
...
@@ -27,3 +28,13 @@
</LinearLayout>
</FrameLayout>
=======
<fragment
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:map=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/map"
android:name=
"com.google.android.gms.maps.SupportMapFragment"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".spareparts.MapsActivity"
/>
>>>>>>> 7a12c31 (Create google maps activity)
app/src/main/res/values/strings.xml
View file @
9f0851ed
...
...
@@ -82,10 +82,20 @@
<string
name=
"kmthis"
>
200km
</string>
<string
name=
"app_name1"
>
salesApp
</string>
<<<<<<
< HEAD
<string
name=
"title_activity_testingchat1"
>
testingchat1
</string>
<string
name=
"tab_text_1"
>
chats
</string>
<string
name=
"tab_text_2"
>
profile
</string>
<string
name=
"title_activity_maps"
>
Map
</string>
=======
<string
name=
"main_btn1"
>
View top Rated
</string>
<string
name=
"main_btn2"
>
main_btn2
</string>
<string
name=
"main_btn3"
>
main_btn3
</string>
<string
name=
"todo"
>
TODO
</string>
<string
name=
"view_table_head3"
>
view_table_head3
</string>
<string
name=
"view_table_head1"
>
view_table_head1
</string>
<string
name=
"title_activity_maps"
>
MapsActivity
</string>
>>>>>>> 7a12c31 (Create google maps activity)
</resources>
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