-
Notifications
You must be signed in to change notification settings - Fork 1
Choices made
Some bundles need additional settings to work. (like the address where the server is located and port) It's a struggle to type all these settings on a phone and we wanted a better solution for this. The solution had to be easy to use, available on most phones, cheap and quick.
We've researched two options for this
- QR-codes
- NFC
For NFC we had to buy NFC-tags and not every phone has a NFC scanner. You need multiple tags to make it quick because its hard to scan a tag with multiple people at once.
Qr-codes didn't have these disadvantages, almost every phone has a camera these days and the codes can be scanned by multiple people at the same time. There was also no cost related to QR-codes and it is very easy to use.
This is why we chose for QR-codes.
The QR-code generator we made and used can be found here.
In our application we have to communicate with the framework do execute methods on it. This framework we are talking about is Apache Celix. This might not the only project that will be working with Apache Celix on Android, so we want the Apache Celix related part to be reusable. To solve this problem we had to think of a solution. This solution has to have full control over the framework, should be secure and easy to use for new applications. We've found several options and looked into them.
- Android Intent Service
- Android Bound Service
- Android Library project
For a Intent Service you would need two applications. One running the intent service and another which is using the intent service to control the framework. When there would be multiple applications using the same framework this could cause security issues. The applications would be able to see each others bundles on the framework and would be able to control them. This is solvable but quite tricky and time consuming. It is also impossible to fully control a Intent Service ( When it starts and stops running ). An Intent Service requires extra code for the application which want to use it.
A Bound Bervice would also require two applications. This would cause the same security issues as the Intent Service. It would also require extra code to use this in your application.
A Android Library project doesn't have the security issues that the bound and intent service have. Every application would get its' own framework. It could be added to your application with just one line and doesn't require extra code. The library project would act as a wrapper around the Apache Celix framework and make it easy to communicate with it from Android side. This solution fits best in our requirements.
This is why we've chosen for a Android Library project. The Library Project can be found here
To get the Apache Celix framework and the bundles to work for Android we had to cross compile them for the correct architecture. To do this we also needed several libraries to be cross compiled and we needed the correct compilers to do this. We have to modify the code often so we have to cross compile often as well. To do this from the terminal would require a lot of steps. So we needed a good solution for this. The solution had to be easy, quick and useable on our systems. We've looked into two possibilities
- Dockerfiles (cross compile on virtualized machine)
- Shell scripts (cross compile on our own machine)
A Dockerfile would work on almost every operating system. However, it is slower than executing it on your own machine.
A shell script would work quicker than with a Dockerfile but wouldn't work on every system. However, we only use linux systems here and it would work on those computers.
We started with a Dockerfile because this can be used on every system. Eventually we found out that it just took to long and we created shell scripts to do the work. This works better for our development team because we had to cross compile quite often. We still have the Dockerfiles in case anyone wants to use them on different systems.