{"id":16665528,"url":"https://github.com/rn0x/cordova-plugin-stepcounter","last_synced_at":"2026-04-11T20:35:47.324Z","repository":{"id":252561704,"uuid":"840816607","full_name":"rn0x/cordova-plugin-stepcounter","owner":"rn0x","description":"The Cordova StepCounter Plugin allows you to track steps using the device's step counter sensor. It's designed for Android and can be easily integrated into your Cordova applications.","archived":false,"fork":false,"pushed_at":"2024-08-10T21:10:49.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-07T02:42:31.156Z","etag":null,"topics":["cordova","cordova-android","cordova-plugin","counter","fitness","health","pedometer","step"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/cordova-stepcounter","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rn0x.png","metadata":{"files":{"readme":"README-AR.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-08-10T19:14:18.000Z","updated_at":"2024-09-30T18:50:27.000Z","dependencies_parsed_at":"2024-08-10T19:15:20.251Z","dependency_job_id":"b4fbe645-523c-40f3-90d6-3992b142836c","html_url":"https://github.com/rn0x/cordova-plugin-stepcounter","commit_stats":null,"previous_names":["rn0x/cordova-plugin-stepcounter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rn0x%2Fcordova-plugin-stepcounter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rn0x%2Fcordova-plugin-stepcounter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rn0x%2Fcordova-plugin-stepcounter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rn0x%2Fcordova-plugin-stepcounter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rn0x","download_url":"https://codeload.github.com/rn0x/cordova-plugin-stepcounter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239011468,"owners_count":19567671,"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":["cordova","cordova-android","cordova-plugin","counter","fitness","health","pedometer","step"],"created_at":"2024-10-12T11:07:22.639Z","updated_at":"2025-10-26T10:09:11.477Z","avatar_url":"https://github.com/rn0x.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# إضافة StepCounter لـ Cordova\n\n\u003cdiv align=\"center\"\u003e\n\n\u003ca href=\"README-AR.md\" style=\"margin-right: 20px; text-decoration: none;\"\u003e📝 التوثيق بالعربية\u003c/a\u003e\n\u003ca href=\"README.md\" style=\"text-decoration: none;\"\u003e📝 English Documentation\u003c/a\u003e \u003cbr\u003e\n\n[![License](https://img.shields.io/badge/license-GPL3.0-blue.svg)](https://github.com/rn0x/cordova-plugin-stepcounter/blob/main/LICENSE)\n[![npm version](https://badge.fury.io/js/cordova-stepcounter.svg)](https://badge.fury.io/js/cordova-stepcounter)\n![VIEWS](https://komarev.com/ghpvc/?username=rn0x-cordova-plugin-stepcounter\u0026label=REPOSITORY+VIEWS\u0026style=for-the-badge)\n\n\u003c/div\u003e\n\n## نظرة عامة\nإضافة StepCounter لـ Cordova تتيح لك تتبع الخطوات باستخدام مستشعر عداد الخطوات في الجهاز. تم تصميمها خصيصًا لنظام Android ويمكن دمجها بسهولة في تطبيقات Cordova الخاصة بك.\n\n## الميزات\n- بدء وإيقاف عد الخطوات.\n- استرجاع عدد الخطوات الحالي.\n- إدارة الأذونات تلقائيًا.\n\n## التثبيت\n\n### إضافة الإضافة\nلتثبيت إضافة StepCounter في مشروع Cordova الخاص بك، استخدم الأمر التالي:\n\n```bash\ncordova plugin add cordova-plugin-stepcounter\n```\n\nأو يمكنك تثبيتها مباشرة من مستودع الإضافة:\n\n```bash\ncordova plugin add https://github.com/rn0x/cordova-plugin-stepcounter.git\n```\n\n### إزالة الإضافة\nإذا كنت بحاجة إلى إزالة الإضافة من مشروعك، استخدم الأمر التالي:\n\n```bash\ncordova plugin rm cordova-plugin-stepcounter\n```\n\n### هيكل الدليل\n\n```\ncordova-plugin-stepcounter/\n├── src/\n│   └── android/\n│       └── StepCounter.java\n├── www/\n│   └── StepCounter.js\n├── plugin.xml\n└── package.json\n```\n\n## الاستخدام\n\n### واجهة برمجة التطبيقات (API)\nتوفر الإضافة ثلاث طرق رئيسية: `start` و `stop` و `getStepCount`.\n\n#### بدء عد الخطوات\nابدأ مستشعر عداد الخطوات وابدأ في عد الخطوات.\n\n```javascript\ncordova.plugins.stepCounter.start(\n    function(successMessage) {\n        console.log(successMessage);\n    },\n    function(errorMessage) {\n        console.error(errorMessage);\n    }\n);\n```\n\n#### إيقاف عد الخطوات\nإيقاف مستشعر عداد الخطوات.\n\n```javascript\ncordova.plugins.stepCounter.stop(\n    function(successMessage) {\n        console.log(successMessage);\n    },\n    function(errorMessage) {\n        console.error(errorMessage);\n    }\n);\n```\n\n#### الحصول على عدد الخطوات الحالي\nاسترجاع عدد الخطوات الحالي.\n\n```javascript\ncordova.plugins.stepCounter.getStepCount(\n    function(stepCount) {\n        console.log(\"Current step count: \" + stepCount);\n    },\n    function(errorMessage) {\n        console.error(errorMessage);\n    }\n);\n```\n\n### دمج React\nلاستخدام إضافة StepCounter في تطبيق React، يجب التأكد من أن Cordova متكامل بشكل صحيح. إليك مثال على كيفية استخدام الإضافة داخل مكون React.\n\n#### مثال على مكون React\n\n```javascript\nimport React, { useEffect, useState } from 'react';\n\nfunction StepCounterComponent() {\n    const [stepCount, setStepCount] = useState(0);\n    const [isCounting, setIsCounting] = useState(false);\n\n    useEffect(() =\u003e {\n        document.addEventListener(\"deviceready\", onDeviceReady, false);\n        return () =\u003e {\n            document.removeEventListener(\"deviceready\", onDeviceReady, false);\n        };\n    }, []);\n\n    const onDeviceReady = () =\u003e {\n        console.log(\"Device is ready\");\n    };\n\n    const startCounting = () =\u003e {\n        cordova.plugins.stepCounter.start(\n            (successMessage) =\u003e {\n                console.log(successMessage);\n                setIsCounting(true);\n            },\n            (errorMessage) =\u003e {\n                console.error(errorMessage);\n            }\n        );\n    };\n\n    const stopCounting = () =\u003e {\n        cordova.plugins.stepCounter.stop(\n            (successMessage) =\u003e {\n                console.log(successMessage);\n                setIsCounting(false);\n            },\n            (errorMessage) =\u003e {\n                console.error(errorMessage);\n            }\n        );\n    };\n\n    const fetchStepCount = () =\u003e {\n        cordova.plugins.stepCounter.getStepCount(\n            (count) =\u003e {\n                setStepCount(count);\n            },\n            (errorMessage) =\u003e {\n                console.error(errorMessage);\n            }\n        );\n    };\n\n    return (\n        \u003cdiv\u003e\n            \u003ch1\u003eعداد الخطوات\u003c/h1\u003e\n            \u003cp\u003eالخطوات: {stepCount}\u003c/p\u003e\n            \u003cbutton onClick={startCounting} disabled={isCounting}\u003e\n                ابدأ العد\n            \u003c/button\u003e\n            \u003cbutton onClick={stopCounting} disabled={!isCounting}\u003e\n                توقف عن العد\n            \u003c/button\u003e\n            \u003cbutton onClick={fetchStepCount}\u003eاحصل على عدد الخطوات\u003c/button\u003e\n        \u003c/div\u003e\n    );\n}\n\nexport default StepCounterComponent;\n```\n\n### المساهمة\n\n#### كيفية المساهمة\nنرحب بالمساهمات في إضافة StepCounter لـ Cordova. يمكنك المساهمة عن طريق:\n\n- الإبلاغ عن الأخطاء واقتراح الميزات من خلال قضايا GitHub.\n- تقديم طلبات السحب مع إصلاحات الأخطاء أو الميزات الجديدة.\n\n#### إعداد بيئة التطوير\n1. استنساخ المستودع:\n    ```bash\n    git clone https://github.com/rn0x/cordova-plugin-stepcounter.git\n    cd cordova-plugin-stepcounter\n    ```\n\n2. قم بإجراء التغييرات واختبارها محليًا مع مشروع Cordova الخاص بك.\n\n3. قدم طلب سحب مع وصف واضح لتغييراتك.\n\n#### الترخيص\nهذه الإضافة مرخصة بموجب ترخيص GPL 3.0. انظر ملف [`LICENSE`](/LICENSE) لمزيد من المعلومات.\n\n#### التواصل\nلأي استفسارات أو تعليقات، لا تتردد في فتح قضية على مستودع GitHub.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frn0x%2Fcordova-plugin-stepcounter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frn0x%2Fcordova-plugin-stepcounter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frn0x%2Fcordova-plugin-stepcounter/lists"}