Created GPS functionality and basic image import

master
Joshua Sigona 4 years ago
commit 7bac7e5452
  1. 5
      AndroidResources/res/mipmap-anydpi-v26/ic_launcher.xml
  2. BIN
      AndroidResources/res/mipmap-hdpi/ic_launcher.png
  3. BIN
      AndroidResources/res/mipmap-hdpi/ic_launcher_foreground.png
  4. BIN
      AndroidResources/res/mipmap-mdpi/ic_launcher.png
  5. BIN
      AndroidResources/res/mipmap-mdpi/ic_launcher_foreground.png
  6. BIN
      AndroidResources/res/mipmap-xhdpi/ic_launcher.png
  7. BIN
      AndroidResources/res/mipmap-xhdpi/ic_launcher_foreground.png
  8. BIN
      AndroidResources/res/mipmap-xxhdpi/ic_launcher.png
  9. BIN
      AndroidResources/res/mipmap-xxhdpi/ic_launcher_foreground.png
  10. BIN
      AndroidResources/res/mipmap-xxxhdpi/ic_launcher.png
  11. BIN
      AndroidResources/res/mipmap-xxxhdpi/ic_launcher_foreground.png
  12. 4
      AndroidResources/res/values/values.xml
  13. BIN
      Icon.png
  14. 108
      Images.xcassets/AppIcon.appiconset/Contents.json
  15. BIN
      Images.xcassets/AppIcon.appiconset/Icon-1024.png
  16. BIN
      Images.xcassets/AppIcon.appiconset/Icon-120.png
  17. BIN
      Images.xcassets/AppIcon.appiconset/Icon-152.png
  18. BIN
      Images.xcassets/AppIcon.appiconset/Icon-167.png
  19. BIN
      Images.xcassets/AppIcon.appiconset/Icon-180.png
  20. BIN
      Images.xcassets/AppIcon.appiconset/Icon-40.png
  21. BIN
      Images.xcassets/AppIcon.appiconset/Icon-58.png
  22. BIN
      Images.xcassets/AppIcon.appiconset/Icon-76.png
  23. BIN
      Images.xcassets/AppIcon.appiconset/Icon-80.png
  24. BIN
      Images.xcassets/AppIcon.appiconset/Icon-87.png
  25. 6
      Images.xcassets/Contents.json
  26. BIN
      LaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib
  27. BIN
      LaunchScreen.storyboardc/Info.plist
  28. BIN
      LaunchScreen.storyboardc/UIViewController-01J-lp-oVM.nib
  29. 31
      LaunchScreen.storyboardc/designable.storyboard
  30. BIN
      background.png
  31. 61
      build.settings
  32. 23
      config.lua
  33. 38
      main.lua

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 664 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 920 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#e2e2e2</color>
</resources>

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 B

@ -0,0 +1,108 @@
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-40.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-58.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-87.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-80.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-120.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-180.png",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-76.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-152.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "Icon-167.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "Icon-1024.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 581 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 859 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

@ -0,0 +1,61 @@
--
-- For more information on build.settings, see the Project Build Settings guide at:
-- https://docs.coronalabs.com/guide/distribution/buildSettings
--
settings =
{
orientation =
{
-- Supported values for orientation:
-- portrait, portraitUpsideDown, landscapeLeft, landscapeRight
default = "portrait",
supported = { "portrait", },
},
--
-- Android section
--
android =
{
usesPermissions =
{
"android.permission.INTERNET",
-- Permission to retrieve current location from the GPS
"android.permission.ACCESS_FINE_LOCATION",
-- Permission to retrieve current location from WiFi or cellular service
"android.permission.ACCESS_COARSE_LOCATION",+
},
},
--
-- iOS section
--
iphone =
{
xcassets = "Images.xcassets",
plist =
{
UIStatusBarHidden = false,
UILaunchStoryboardName = "LaunchScreen",
},
},
--
-- Plugins section
--
plugins =
{
},
--
-- Project section
--
excludeFiles =
{
-- Exclude unnecessary files for each platform
all = { "Icon.png", "Icon-*dpi.png", "Images.xcassets", },
android = { "LaunchScreen.storyboardc", },
},
}

@ -0,0 +1,23 @@
--
-- For more information on config.lua see the Project Configuration Guide at:
-- https://docs.coronalabs.com/guide/basics/configSettings
--
application =
{
content =
{
width = 320,
height = 480,
scale = "letterbox",
fps = 60,
--[[
imageSuffix =
{
["@2x"] = 2,
["@4x"] = 4,
},
--]]
},
}

@ -0,0 +1,38 @@
-----------------------------------------------------------------------------------------
--
-- main.lua
--
-----------------------------------------------------------------------------------------
local latitude = display.newText( "-", 100, 50, native.systemFont, 16 )
local longitude = display.newText( "-", 100, 100, native.systemFont, 16 )
local altitude = display.newText( "-", 100, 150, native.systemFont, 16 )
local accuracy = display.newText( "-", 100, 200, native.systemFont, 16 )
local speed = display.newText( "-", 100, 250, native.systemFont, 16 )
local direction = display.newText( "-", 100, 300, native.systemFont, 16 )
local time = display.newText( "-", 100, 350, native.systemFont, 16 )
local locationHandler = function( event )
if ( event.errorCode ) then
native.showAlert( "GPS Location Error", event.errorMessage, {"OK"} )
print( "Location error: " .. tostring( event.errorMessage ) )
else
local latitudeText = string.format( '%.4f', event.latitude )
latitude.text = latitudeText
local longitudeText = string.format( '%.4f', event.longitude )
longitude.text = longitudeText
local altitudeText = string.format( '%.3f', event.altitude )
altitude.text = altitudeText
local accuracyText = string.format( '%.3f', event.accuracy )
accuracy.text = accuracyText
local speedText = string.format( '%.3f', event.speed )
speed.text = speedText
local directionText = string.format( '%.3f', event.direction )
direction.text = directionText
local timeText = string.format( '%.0f', event.time )
time.text = timeText
end
end
-- Activate location listener
Runtime:addEventListener( "location", locationHandler )
Loading…
Cancel
Save