Is it possible to code an app capable of running in the background on MIT App Inventor? - app-inventor

I am coding an app on MIT App inventor that detects when someone is walking and on their phone at the same time. One aspect of the app that my group wants to include is having the app run in the background and detect when other apps are running in the foreground. I looked on the MIT App Inventor forum and found no answers as to how I can do this. Is creating an app that runs in the background possible on MIT App Inventor?
I looked at solutions in other coding languages for some potential insight and found something about an activity manager working in java, but even if this code is somewhat transferable I wouldn't know how to apply it to get the desired result.

Background services are currently not available in App Inventor. There are workarounds such as using Clock component to continuously run and execute a task. Other alternative is to keep the screen on (using extension). However, these approaches could potentially result in higher battery usage.

Related

Struggling to find good Examples of iOS app clip & Android instant Apps

I've searched for examples of iOS app clip & Android instant Apps but could not find more than few examples.
I am looking for released apps in App Store/Google Play or open source examples.
good examples could make developing these new features easier and gives developers new creative ideas to use these wonderful tools.
Do you have an app that utilizes App clip or instant app?
How did this affect your app?
What is the challenges you have faced?
Note: I know this is not a typical question but it need to be asked in a community full of great developers who love to share knowledge with others, and I don't think there is a better place than here.
Intro
I know it's been 10 months since you posted the question but I just stumbled upon it now... I've developed an app called ARShades for both iOS and Android that allows the user to try glasses on via Augmented Reality and I'm still in charge of development. The app supports both Instant App and App Clip, although I'm facing troubles making the the app banner show for the App Clip.
Firebase issues
As far as I can tell developing App Clips is a tad harder than develeloping Instant Apps, I'll tell you why. The main apps for both systems make extensive use of Firebase Firestore and many other features. This isn't a problem on Android where sockets are supported across the board, while on iOS they are only supported in the main app, so I had to use REST API to read and write data on Firebase when developing the App Clip, it's been a nightmare since it was the first time for me dealing with REST APIs (I just finished yesterday and published the update).
App Size
Another issue I faced is related to reducing the app size. On Android I had to remove all the unused images and compress the remamining ones. On iOS I had to separate the asset catalogues between: used only by the main app, shared, and used only by app clip. And of course I went through some compression works there too. I forgot to mention that I developed a new app as Instant App on Android, while you cannot do the same on iOS since it must be in the same project.
App to site linking
Another insidious part was the linking of the site to the apps. I managed to do it on Android by making changes to the manifest and specifying the host, while I can't seem to find a way to link the App Clip to the site in ay way. I've done everything the documentation says. I've put the apple app site association file in the .well-known folder but nothing, no banner shows up. I'll keep working on that.
Edit: Everything is now solved.
Conclusions
So, to sum up, I've found Instant Apps better on the developing and hassle side of things, the support sockets, hence the full suite of frameworks the full apps have. I hope I kind of answered your question, although I think you have documented yorself elsewhere in these past 10 months XD
Links to Android: https://play.google.com/store/apps/details?id=it.spaarkly.arshades&hl=en_US&gl=US
Link to iOS: https://apps.apple.com/us/app/arshades-demo/id1586661818
Link for trying Instant App / App Clip

Smart home application

I'm planning to code a smart home application for touch sensitive windows 10 tab (already I have) which can hang in wall.
I need:
Weather API data viewer, Alarm manager, Scheduled music player for morning and evening, Google calendar synced event viewer, Arduino sensor reading (home temp and humidity) .
I tried and designed a interface using C# and WPF. But my goal couldn't reached due to sorted issues below. [See attached image.]
C# - Not enough support for UI. No transparent/ no curve buttons /etc.
WPF - Less supportive for some extension and discontinued product.
ASP.Net - Less knowledge and I believe mp3 player and other extra sensor readings will not success through this.
So I need to know is there any specific softwares for designing Windows os smart home applications. Please help on this.
Try Flutter or Electron.
Flutter was designed by google it is opensource and runs on all operating systems.
I think it uses dart as a main language.
Electron on the other hand uses mostly HTML, CSS and Javascript. But it should be easier to design the user interfaces. For example Discord and VS Code were built using Electron.

iBeacon App State - Best practice?

What is the preferred state of the app in order to receive a proximity-based offer - App in foreground, background or not-yet-launched?
There are mixed opinions on this, some say how should a user know he should have the app launched, on the other hand if the app is not launched, a deamon process needs to be listening to BLE packets (and consuming battery).
I'm trying to understand what some of the real applications are doing in practice.
Beacon apps that present offers when a user is nearby typically require background detection of beacons, because it is unlikely the user will know to manually open the app at the right time.
This is possible on both iOS and Android, provided that the beacon app is already installed on the phone. Both platforms allow ways to do low power beacon scanning in the background that will deliver a callback to an app when a beacon matching an identifier pattern is detected.
The basic practice is to have the app register for these callbacks the first time it runs, so even if the phone is rebooted, it will be notified of a detection.
As you say, background scanning requires some battery usage, but there are optimizations that make this acceptable on both Android and iOS. These optimizations are automatic on iOS and the implementation closed source and undocumented. On Android, similar optimizations are provided by the open source Android Beacon Library. You can read about how background launching works here and battery saving here.
Full disclosure: I am lead developer on the Android Beacon Library project.

How to track WinRT applications (in Win32 it was simple)?

In "old" times I created simple tool for Windows users, which tracks what they were doing in the front of computer (where simple activity monitor). I was using Win32 api and functions like GetForegroundWindow, GetWindowThreadProcessId, etc.
Yesterday I installed new Windows 8 and tired to run my program. I got 50% success: for "classic" desktop it works like always:).
For Metro UI I just got one application: WWAHost :( without any details.
So my question is: is there a any way for tracking active application in Metro UI?
Thanks for help
UPDATE:
I'm trying to access Metro UI app from Win32, I know that accessing Metro app from another Metro app is impossible
You see, in WinRT, your application is the top-most application. And when your app is not the top-most application then your threads are suspended and the kernel will not schedule any more operations for your app. End of story.
This means what you are wanting to accomplish cannot be done in WinRT. You are thinking more like a resident app or a service with access to the desktop. Those apps have two advantages. 1) they are always running. And, 2) they have the API to do what you are wanting.
WinRT intentionally puts apps in a sandbox so that the user's experience, performance and battery life are protected. Your scenario and scores more like yours underscore the continuing need for desktop apps. (as long as there is a continuing need for those types of apps ;)).
Sorry, if this is bad news.
As for enumerating other apps. This is also not possible. You cannot know if another app is installed or if it is running. You can call out to another app through protocol activation or file activation or (in a sense) through the share contract. But you are unaware if they get the message and if the user has it installed in the first place. And this is by design.
It is worth mentioning that you can pinvoke to Win32 APIs in your WinRT application. It causes lots of problems and can create a headache to get certified into the store. But even then, not all APIs are open to you. And you will find this particular use case is a non-starter.
I am sure this will not be possible. With Windows 8 'Metro' only a single application is active. All other applications will be in a suspended state whilst the topmost application is running. This makes it impossible to write an application that monitors other applications which are currently executing.
See the numerous articles on the Windows 8 app lifecycle.

Designing WP7 App

I have made one windows phone based application. i want some designing ideas from you wp7 people.how can we apply styles,transparent background or the design which suits wp7 app. may i have some links which provides snaps for good designed apps. please help
One app that jumps to my mind when talking about great use and adaption to the metro design, it's "Cocktail Flow". It has very well done implementations of many design cues for WP7. As special treats it has features like parallax effects controled via gyroscope.
You can find a free version on the marketplace. Definitely worth a look.
MSDN user experience guidelines are pretty good, User Experience Design Guidelines for Windows Phone.
Also, it helps to install some popular apps from the marketplace and study their design.
The BEST thing you can possibly do to get a good idea of how to build a great WP7 app is to own a Windows Phone, and use it as your primary phone.
Get used to the way the operating system flows. Download cool apps. As time goes on you begin to understand from the user's perspective what a "good" app looks (and more importantly) feels like. It's a hard thing to nail down in a "user experience" spec. I find that a lot of people who set off to build a WP7 app do so before understanding how apps are supposed to behave on the platform. It is vital that you understand how users expect applications on the windows phone to operate. If you use a windows phone for a good 3-4 months, and really make an effort of butting it through the steps, it will be hard to walk away from that experience without a very clear idea of what a "good" application looks like for the windows phone.
That being said, and while I honestly don't believe that there are any short cuts to good design for the windows phone, I highly recommend downloading the following apps, and playing around with them to get a feel for "good" UI:
Wordament
Cocktail Flow (previously mentioned)
Twitter
Spotify
Yelp
Any of the built in applications (Office, Zune, Internet Explorer)
The above are good to start with, but again, you're really not going to understand it unless you live and breath it everyday for at least a few months.

Resources