{"id":20399135,"url":"https://github.com/streetcomplete/streetmeasure","last_synced_at":"2025-04-09T07:08:27.891Z","repository":{"id":102993561,"uuid":"583350242","full_name":"streetcomplete/StreetMeasure","owner":"streetcomplete","description":"Measure distances with AR","archived":false,"fork":false,"pushed_at":"2025-03-02T18:26:37.000Z","size":1003,"stargazers_count":84,"open_issues_count":0,"forks_count":4,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-02T02:39:36.176Z","etag":null,"topics":["android","arcore","arcore-android","openstreetmap","osm"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/streetcomplete.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-29T14:13:31.000Z","updated_at":"2025-03-31T16:00:16.000Z","dependencies_parsed_at":"2024-11-15T04:27:19.549Z","dependency_job_id":"2aacbbbd-647b-4597-ae0a-c3460ad8c128","html_url":"https://github.com/streetcomplete/StreetMeasure","commit_stats":{"total_commits":57,"total_committers":3,"mean_commits":19.0,"dds":"0.052631578947368474","last_synced_commit":"a17fc88a7ff323ae906e62e632085fbbb8020084"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streetcomplete%2FStreetMeasure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streetcomplete%2FStreetMeasure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streetcomplete%2FStreetMeasure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streetcomplete%2FStreetMeasure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/streetcomplete","download_url":"https://codeload.github.com/streetcomplete/StreetMeasure/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247994121,"owners_count":21030050,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","arcore","arcore-android","openstreetmap","osm"],"created_at":"2024-11-15T04:27:13.491Z","updated_at":"2025-04-09T07:08:27.868Z","avatar_url":"https://github.com/streetcomplete.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# StreetMeasure\n\nA tool to measure (street) widths via Google's ARCore.\n\n[\u003cimg src=\"https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png\" alt=\"Get it on Google Play\" height=\"80\"\u003e](https://play.google.com/store/apps/details?id=de.westnordost.streetmeasure)\n[\u003cimg src=\"https://gitlab.com/IzzyOnDroid/repo/-/raw/master/assets/IzzyOnDroid.png\" alt=\"Get it on IzzyOnDroid\" height=\"80\"\u003e](https://apt.izzysoft.de/fdroid/index/apk/de.westnordost.streetmeasure)\n[\u003cimg src=\".github/Github-Apk-badge.png\" alt=\"Get APK from GitHub\" height=\"80\"\u003e](https://github.com/streetcomplete/StreetMeasure/releases/)\n\n## Screenshots\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/screenshot1.jpg\" alt=\"Screenshot 1\" width=\"45%\"\u003e\n  \u003cimg src=\"assets/screenshot2.jpg\" alt=\"Screenshot 2\" width=\"45%\"\u003e\n\u003c/p\u003e\n\n## History\n\nThis used to be a component within [StreetComplete](https://github.com/streetcomplete/StreetComplete/) but has been outsourced into an own app due to license issues:\nIt turned out that Google's [ARCore library is not licensed under the Apache license after all](https://github.com/google-ar/arcore-android-sdk/issues/1538), but is closed source and its usage is subject to additional terms.\n\nThis means that this library cannot be used by any GPL licensed project, hence, I took the AR measuring stuff and released it in an own app under a permissive license which does not have this constraint.\n\nFor this reason, the app is not available in the main F-Droid repository and never will.\n\n## Usage\n\n### Requesting a measure result\n\nYou can call this activity for result to let the user make a measurement and return its result to\nyour app. See the [Android documentation](https://developer.android.com/training/basics/intents/result)\non how to do this generally.\n\nA type-safe `ActivityResultContract` interface is available at [MeasureContract.kt](https://github.com/streetcomplete/StreetMeasure/blob/master/app/src/main/java/de/westnordost/streetmeasure/MeasureContract.kt), you can just copy it.\n\nAlternatively, consult the [documentation in the code](https://github.com/streetcomplete/StreetMeasure/blob/master/app/src/main/java/de/westnordost/streetmeasure/MeasureActivity.kt#L577-L633) which raw parameters are available and what is returned in the result\n`Intent` if you want to do it the old way with [`Activity.startActivityForResult`](https://developer.android.com/reference/android/app/Activity#startActivityForResult(android.content.Intent,%20int)).\n\nIn either case, do not forget to cover the likely case that the measure app is not installed yet,\ni.e. catch the `ActivityNotFoundException` and for example forward the user to the Play Store:\n\n```kotlin\nstartActivity(Intent(Intent.ACTION_VIEW, Uri.parse(\"market://details?id=de.westnordost.streetmeasure\")))\n```\n\n### Checking if AR measure is available at all\n\nIf the following function does return false, measuring with AR will not work anyway, so in that case\nyou probably don't even want to show the user the option to do so.\n\n```kotlin\nfun hasArMeasureSupport(context: Context): Boolean =\n  // extra requirements for Sceneform: min Android SDK and OpenGL ES 3.1\n  Build.VERSION.SDK_INT \u003e= Build.VERSION_CODES.N\n  \u0026\u0026 context.getSystemService\u003cActivityManager\u003e()!!.deviceConfigurationInfo.glEsVersion.toDouble() \u003e= 3.1\n  // Google Play is required to lead the user through installing the app\n  \u0026\u0026 (\n    // app is already installed\n    context.packageManager.isPackageInstalled(\"de.westnordost.streetmeasure\")\n    // or at least google play is installed\n    || context.packageManager.isPackageInstalled(\"com.android.vending\")\n  )\n\nprivate fun PackageManager.isPackageInstalled(packageName: String): Boolean =\n  try { getPackageInfo(packageName, 0) != null } catch (e: NameNotFoundException) { false }\n```\n\n- it is not available in Android versions below 7.0 and requires OpenGL ES 3.1\n- if not already installed, the measuring app is only available on Google Play store (not on\n  F-Droid). So if neither of the two is installed, no point in showing it to the user as an option. It is of course possible to load the app from GitHub and also to sideload ARCore (=\"Google Play Services for AR\") from some other more or less trustworthy source, but this is nothing the user could be led through automatically in the UI.\n\nIf it returns true, it may still be the case that [his device is not supported](https://developers.google.com/ar/devices)\nbut this is something you cannot check for at this point. The list of supported devices is not really publicly available directly from Google as a CSV and in any case is updated all the time, so getting the CSV one time from a third party and then not updating it is bound to break for new devices being added to the list.\n\nIn any case, do not forget to add `\u003cpackage android:name=\"de.westnordost.streetmeasure\"/\u003e` and\n`\u003cpackage android:name=\"com.android.vending\"/\u003e` to the\n[`\u003cqueries\u003e`](https://developer.android.com/guide/topics/manifest/queries-element) block in your\nAndroid manifest. In Android 11 onwards, it must be declared which packages the app should be\ncapable of communicating with, otherwise the app may not find the app at all.\n\n## License\n\nThis software is released under the terms of the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstreetcomplete%2Fstreetmeasure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstreetcomplete%2Fstreetmeasure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstreetcomplete%2Fstreetmeasure/lists"}