Skip to content

Commit

Permalink
Merge branch 'master' into 3889-only-team-members-able-to-alter-data
Browse files Browse the repository at this point in the history
  • Loading branch information
Okuro3499 authored Jul 29, 2024
2 parents e5d49a4 + 4c2c917 commit f438931
Show file tree
Hide file tree
Showing 27 changed files with 161 additions and 431 deletions.
109 changes: 25 additions & 84 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,98 +1,39 @@
# myPlanet
# ![ole_logo](https://github.com/user-attachments/assets/088e6283-42bb-4e6c-b6ed-67f32f341c44) myPlanet

myPlanet is the Android port of the [Planet web application](https://github.com/open-learning-exchange/planet). It will work with Planet community / nation.
[![chat on discord](https://img.shields.io/discord/1079980988421132369?logo=discord&color=%237785cc)](https://discord.gg/BVrFEeNtQZ)
[![license: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
[![latest development release](https://img.shields.io/github/v/release/open-learning-exchange/myplanet)](https://github.com/open-learning-exchange/myplanet/releases/latest)
[![Get myPlanet on Google Play Store](https://img.shields.io/endpoint?url=https%3A%2F%2Fplay.cuzi.workers.dev%2Fplay%3Fi%3Dorg.ole.planet.myplanet%26gl%3DUS%26hl%3Den%26l%3Drelease%26m%3D%24version&logo=google-play&logoColor=green&color=green)](https://play.google.com/store/apps/details?id=org.ole.planet.myplanet)

### App Screenshots:
**myPlanet** is a mobile app designed to complement the [Open Learning Exchange](https://ole.org)’s Learning Management System, [Planet](https://github.com/open-learning-exchange/planet). Tailored for both offline and online use, myPlanet ensures continuous learning and community engagement even in areas with limited internet access. It seamlessly integrates with Planet's community and nation instances, offering a mobile platform to access user-created educational resources such as books, videos, and courses.

<p align="middle">
<img width="757" alt="Screenshot 2019-09-06 at 8 47 46 AM" src="https://user-images.githubusercontent.com/2836302/64419353-439ef300-d08c-11e9-8e78-40d086b251df.png">
<img width="755" alt="Screenshot 2019-09-06 at 8 48 11 AM" src="https://user-images.githubusercontent.com/2836302/64419358-46014d00-d08c-11e9-9c7c-dfb28ca2ef26.png">
<img width="763" alt="Screenshot 2019-09-06 at 9 02 11 AM" src="https://user-images.githubusercontent.com/2836302/64419366-4d285b00-d08c-11e9-9770-740ce5ad278b.png">
<img width="771" alt="Screenshot 2019-09-06 at 9 53 43 AM" src="https://user-images.githubusercontent.com/2836302/64419378-53b6d280-d08c-11e9-86cb-53814e832795.png">
</p>
- [Feature Highlights](#feature-highlights)
- [About myPlanet](#about-myplanet)
- [How To Use](#how-to-use)
- [Contact](#contact)

## Feature Highlights

### Getting started for Users

On your Android device, go to [Releases](https://github.com/open-learning-exchange/myplanet/releases) and download the latest version of the APK of the Application. Click on the downloaded APK and choose `install`.
- **Offline Access** - Download educational materials and access them without an internet connection.
- **Content Synchronization** - Sync with the Planet server to get the latest educational content.
- **AI Chatbot**: Provides an AI-powered chatbot to assist users with navigating the app, finding resources, and answering questions.
- **Teams and Enterprises**: Collaborate with other users, complete tasks and courses, and download resources to work on together.
- **Multilingual Support**: Supports English, Arabic, Spanish, French, Nepali, and Somali

### Getting started for Interns
## About myPlanet

Virtual Interns who will be working on the project should start out by setting up the repository on their own device in Android Studio. The steps are very similar to the process followed for cloning the [open-learning-exchange](https://github.com/open-learning-exchange/open-learning-exchange.github.io) repository. The only difference is that you **do not need to fork** the myPlanet repository as you are now a part of the team.
myPlanet is a mobile application designed as an offline extension of the Planet learning system. It allows users to access a broad range of learning resources, including books, videos, and interactive learning games, without needing an internet connection. This functionality ensures that learners can engage with educational materials anywhere, even in areas with unreliable or no internet access.

Open the myPlanet repository on Android Studio. Click on `Build` to sync and build the project. If you face any issues in syncing or compiling the project, use the [mobile gitter channel](https://gitter.im/open-learning-exchange/mobile) or the Mobile Hacking Hangout to discuss and solve your difficulties with the team.
The app functions as a bridge between the user’s device and the Planet server, facilitating data synchronization. Learners can download selected collections of learning resources from the server and store them locally on their mobile devices. This personalized approach helps users access content tailored to their specific needs and interests.

> We also encourage you add the solutions to any syncing or compiling issues to this README document in the Troubleshooting section as a guidance to the future virtual interns.
In addition to providing access to learning materials, myPlanet includes robust software tools for content management, learner evaluation, and course creation. Users can manage their learning progress, track performance, and participate in interactive activities. The app also supports frequent assessments and provides feedback metrics, making it a valuable resource for learners, coaches, and administrators alike.

#### Setting up the Android device for Development and Testing
By leveraging myPlanet, users gain seamless access to the Planet system’s extensive repository of educational resources, enhancing the accessibility and usability of the learning system for individuals of all ages and expertise levels.

As the myPlanet App will mostly be used on 10-inch OLE Tablets, the best way to run and test the application will be on the 10-inch tablet emulator (unless you have an actual 10-inch tablet):
## How To Use

1. If you have completed the First Steps, then you have already enabled virtualization on your device.
2. After opening the myPlanet project in Android Studio, sync it by going to `file/sync project with gradle files`.
For the app usage manual, please visit the [myPlanet Manual page](https://open-learning-exchange.github.io/#!pages/manual/myplanet/overview.md) on OLE Support.

<img width="507" alt="Screen Shot 2019-04-11 at 11 04 15 PM" src="https://user-images.githubusercontent.com/29234807/56009589-4c8ec280-5cae-11e9-9907-908e61c5a8c6.png">
## Contact

3. Once syncing is over, click on `Run`.
4. At the bottom of the dialog, click on `Add New Virtual Device`.
5. Choose `Tablet` and then choose the `10.1" WXGA Tablet` (1280 x 800 mdpi).
6. Choose API level according to the latest release (25 or greater) and continue.
7. Verify the configuration and click finish.

Your device should configure and the application will run on the virtual device.

#### Logging in to myPlanet

Now the app needs to sync with the server to be able to log in. Click on the settings icon on the top right and fill in the following.

1. **Planet Server Address**: If you are on an emulator and running planet on your machine your planet server address will most probably be **10.0.2.2:3100**. If your instance of planet is running on a raspberry pi your server address would be raspberry-pi-ip-address:3100. The planet instance might not always run on port 3100, so double check the ip address and port your instance of planet is running on.

2. **Server Pin**: Login to Planet with the admin account(the one that was created in the first steps), go to manager settings on the top right and find table pin/server pin there.

<img width="1920" alt="Screen Shot 2020-08-23 at 4 47 21 PM" src="https://user-images.githubusercontent.com/6264813/90988484-14b1b380-e561-11ea-8f9e-979fdc8e5be4.png">

Enter the details and press sync.

![Screenshot_1597629265](https://user-images.githubusercontent.com/6264813/90350501-5c898580-e00b-11ea-8cfe-07ace2907b62.png)

Finally you need to create a **new account for development and testing** either on the myPlanet app or on Planet after connecting to the server since at this moment admin login is not supported.

##### Tools

Along with the 10-inch tablet, you can also use an actual device to run and test the application - it is always good to know how the App functions on different screen-sizes and densities.

[Vysor](https://www.vysor.io/) is software that helps display your Android screen into your computer. It helps you explain the issue more in detail. Plus, everybody in the team can see what is happening on your screen, therefore we can help each other in debugging.

##### Creating Issues and Pull Requests

The process for creating issues and pull requests is very similar to First Steps. Remember to branch off of the master branch before working on and creating a new pull request.

#### How to start contributing

If you catch a bug, have a feature request or just see something that could be improved, **create a new issue** and let others know about it so that it can be reviewed. If its apporved you can assign yourself to the issue and start working on it. You don't have to work on every issue you create so feel free to open issues on things you do not understand yet.

Before you start working on any issue make sure that the issue is valid and approved by the members of the team and always assign yourself to the issue so that nobody else works on the same issue.

Since you are just staring out it is important to get some understanding of the codebase and it's structure. A good way to understand the codebase while contributing is to start with simple issues like changing color of a button or fixing the spacing of some element. If you feel more confident you can work on more challenging issues.

Another excellent way to contribute is by adding comments. While going through the codebase if you don't understand a piece of code or feel like a comment could help make the purpose of the code clearer add a comment so that interns that join after you have an easier time understanding the codebase.

Finally don't hesitate to ask for help. You are encouraged to find a solution yourself but if you unable to find one or need a second opinion feel free to reach out.

##### Including the correct format for the code

To maintain uniform formatting of the code, use the following keys combinations in .java, .xml, or any other project files you have changed in Android Studio before committing and pushing the code to the myPlanet repository:

For Windows, use `ctrl + alt + L` to format few lines and `shift + ctrl + alt + L` to format an entire file.

For Linux use `ctrl + alt + super + L`. (super is the Windows icon key next to the alt key)

For Mac: `ctrl + command + shift + L`.

![mac](https://user-images.githubusercontent.com/37878201/43735982-1d0cf1c2-998a-11e8-8edb-5bfea2522a35.png)

Remember, this is an important step to remember so that we are able to maintain a high standard of code.

### Troubleshooting

Some of the issues that you can come across may be related to the obsolete commands, gradle building, the version of Android Studio your are using, etc. Add your problem and the solution to your problem in this section to help future interns.
For any questions or feedback, please join [our Discord server](https://discord.gg/BVrFEeNtQZ).
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "org.ole.planet.myplanet"
minSdkVersion 21
targetSdkVersion 34
versionCode 1720
versionName "0.17.20"
versionCode 1724
versionName "0.17.24"
ndkVersion '21.3.6528147'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
Expand Down Expand Up @@ -106,7 +106,7 @@ dependencies {
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation 'androidx.annotation:annotation:1.8.0'
implementation 'androidx.annotation:annotation:1.8.1'
implementation 'androidx.exifinterface:exifinterface:1.3.7'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
Expand Down Expand Up @@ -170,7 +170,7 @@ dependencies {
implementation "com.github.bumptech.glide:glide:$glide_version"
kapt "com.github.bumptech.glide:compiler:$glide_version"

def media3_version = "1.3.1"
def media3_version = "1.4.0"
implementation "androidx.media3:media3-exoplayer:$media3_version"
implementation "androidx.media3:media3-ui:$media3_version"
implementation "androidx.media3:media3-common:$media3_version"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/org/ole/planet/myplanet/MainApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import org.ole.planet.myplanet.utilities.Constants.PREFS_NAME
import org.ole.planet.myplanet.utilities.LocaleHelper
import org.ole.planet.myplanet.utilities.NetworkUtils.initialize
import org.ole.planet.myplanet.utilities.NetworkUtils.startListenNetworkState
import org.ole.planet.myplanet.utilities.NotificationUtil.cancellAll
import org.ole.planet.myplanet.utilities.NotificationUtil.cancelAll
import org.ole.planet.myplanet.utilities.Utilities
import org.ole.planet.myplanet.utilities.VersionUtils.getVersionName
import java.util.Date
Expand Down Expand Up @@ -186,7 +186,7 @@ class MainApplication : Application(), Application.ActivityLifecycleCallbacks {
override fun onActivitySaveInstanceState(activity: Activity, bundle: Bundle) {}

override fun onActivityDestroyed(activity: Activity) {
cancellAll(this)
cancelAll(this)
}

private fun onAppForegrounded() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import io.realm.Realm
import org.ole.planet.myplanet.MainApplication
import org.ole.planet.myplanet.callback.SyncListener
import org.ole.planet.myplanet.model.RealmUserModel.Companion.populateUsersTable
import org.ole.planet.myplanet.utilities.AndroidDecrypter.Companion.AndroidDecrypter
import org.ole.planet.myplanet.utilities.AndroidDecrypter.Companion.androidDecrypter
import org.ole.planet.myplanet.utilities.Constants.PREFS_NAME
import org.ole.planet.myplanet.utilities.JsonUtils
import org.ole.planet.myplanet.utilities.Utilities
Expand Down Expand Up @@ -41,7 +41,7 @@ class ManagerSync private constructor(context: Context) {
// val decrypt = AndroidDecrypter()
val derivedKey = jsonDoc["derived_key"].asString
val salt = jsonDoc["salt"].asString
if (AndroidDecrypter(userName, password, derivedKey, salt)) {
if (androidDecrypter(userName, password, derivedKey, salt)) {
checkManagerAndInsert(jsonDoc, mRealm, listener)
} else {
listener.onSyncFailed("Name or password is incorrect.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ open class BaseDashboardFragmentPlugin : BaseContainerFragment() {
if (f is TeamDetailFragment) {
b.putBoolean("isMyTeam", true)
}
prefData.setTEAMNAME(title)
prefData.setTeamName(title)
f.arguments = b
homeItemClickListener?.openCallFragment(f)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class AdapterReports(private val context: Context, private var list: RealmResult

override fun onBindViewHolder(holder: ViewHolderReports, position: Int) {
val report = list[position]
reportListItemBinding.tvReportTitle.text = context.getString(R.string.team_financial_report, prefData.getTEAMNAME())
reportListItemBinding.tvReportTitle.text = context.getString(R.string.team_financial_report, prefData.getTeamName())
report?.let {
with(reportListItemBinding) {
val totalIncome = report.sales + report.otherIncome
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class ReportsFragment : BaseTeamFragment() {
val currentDate = Date()
val dateFormat = SimpleDateFormat("EEE_MMM_dd_yyyy", Locale.US)
val formattedDate = dateFormat.format(currentDate)
val teamName = prefData.getTEAMNAME()?.replace(" ", "_")
val teamName = prefData.getTeamName()?.replace(" ", "_")

val intent = Intent(Intent.ACTION_CREATE_DOCUMENT).apply {
addCategory(Intent.CATEGORY_OPENABLE)
Expand Down Expand Up @@ -200,7 +200,7 @@ class ReportsFragment : BaseTeamFragment() {
.equalTo("docType", "report")
.sort("date", Sort.DESCENDING).findAll()
val csvBuilder = StringBuilder()
csvBuilder.append("${prefData.getTEAMNAME()} Financial Report Summary\n\n")
csvBuilder.append("${prefData.getTeamName()} Financial Report Summary\n\n")
csvBuilder.append("Start Date, End Date, Created Date, Updated Date, Beginning Balance, Sales, Other Income, Wages, Other Expenses, Profit/Loss, Ending Balance\n")
for (report in reports) {
val dateFormat = SimpleDateFormat("EEE MMM dd yyyy HH:mm:ss 'GMT'Z (z)", Locale.US)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ class AdapterNews(var context: Context, private val list: MutableList<RealmNews?
viewHolder.rowNewsBinding.btnShowReply.visibility = View.GONE
}
viewHolder.rowNewsBinding.btnShowReply.setOnClickListener {
sharedPreferences?.setREPLIEDNEWSID(finalNews?.id)
sharedPreferences?.setRepliedNewsId(finalNews?.id)
listener?.showReply(finalNews, fromLogin, nonTeamMember)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class OnBoardingActivity : AppCompatActivity() {
return
}

if (prefData.getFIRSTLAUNCH()) {
if (prefData.getFirstLaunch()) {
startActivity(Intent(this, LoginActivity::class.java))
finish()
}
Expand Down Expand Up @@ -139,7 +139,7 @@ class OnBoardingActivity : AppCompatActivity() {
}

private fun finishTutorial() {
prefData.setFIRSTLAUNCH(true)
prefData.setFirstLaunch(true)
startActivity(Intent(this, LoginActivity::class.java))
}
}
Loading

0 comments on commit f438931

Please sign in to comment.