How should i structure a node js and mongodb project - android

I want to build an event app,that has a normal web app that shows events and also an admin panel for the site administrator and another admin panel for a regular event planner where they can see analytics on their events.It also has an ionic pwa for the end users and an Android app/Ios app for the bouncers or gatehuys that has the list of attendees for each event
I haven’t done something of this scale before and i need advice on how to structure the whole thing

Depending on the web app framework chosen, I’d look for the most commonly used/popular boilerplate project/scaffold and use its project structure as a starting point. I found that the number of stars on github is a good indicator of popularity. Even better, find a officially supported scaffolding tool; ie express-generator

Related

Crossplatform Plugin architecture with MAUI

My goal is to create app on Android/Windows using MAUI, and as I want to be able to add to this app more functionality by plugins, I want to create some simple plugin system.
This plugins should be able to subscribe to domain events, add components (like menu items and "pages" components that will be shown in app after menu click), communicate with each other.
So, is there any way to do it cross-platform?
If it was only windows, I would just create plugins dlls, on app start up I need to load them, find every IPlugin or similar, initialize them, etc.
But where to store it on Android? How to compile/load this plugins on Android? (and in future not only Android, but iOS & Mac too)
P.S. I'm super new to MAUI stuff, and need to learn a lot, so appreciate full answers
P.P.S. Not a native English speaker, sorry for mistakes

How to manage & define all data analytics we send from the application?

We are developing mobile application.
When we define a feature, we define also the data analytic events that we should report from the application.
We have some issues where the analytics sometimes doesn't have the exact name and we have differences from Android & iOS.
Also we want to see in one place what the current events that we currently have.
I'm looking for a tool / service that will give me the following:
1. Define data analytics events
2. Export this to Android / iOS files so they will use the same naming convention.
For example, today we define in a document that we want to see the event: "Screen Opened" with the name "Login".
Every developer, iOS / Android, copy the name of the event to his code, one can write "Screen Opened" with "Login" and one with mistake "Log in".
Then the analysis is really hard.
More than that, someday we want to see if we have already defined this event, so we want one place to take a look on.
Is there anything like that in the market?

How make a ticket booking app like BookMyShow

I am building an app which has similar functionally like booking tickets in BookMyShow app.
In my application there are free seats and reserved seats which can be distinguished by color. Also if an user selects a seat that seat be highlighted(or changes color).
I have no idea how to go about it, please Point me in the right direction as I'm new to android.
Well i am also very new to app development world. But i would suggest you a very simple and tricky approach.
You can build a responsive mobile website using javascript frameworks like angularjs,reactjs,ionic,sencha touch or touchstone js.
And render full website in a WEBVIEW using cordova or something.
As i said this approach is the simplest and may not fullfill your needs but is th trickiest one for app development.

move existing web app into a native phone app using a browser wrapper

So lets say there is a fully functional responsive ruby rails web app. This app works and looks great on mobile phones. Unfortunately, this web app can't be seen from the mobile phone app stores, because it's not a native app. Technically you could place an icon on a smart phone that opens up the browser, but obviously this is not optimal.
Is there a way to create a native app (Android, iPhone) that is essentially just a browser, without the navigation bar? This browser's wrapper would just load the web app and behave just like you had opened up the browser.
I have looked into options such as Phonegap and Titanium, but it seems there would be a significant amount of rewriting, and there are very little funds for this.
I don't really know iOS, but doing it in Android will be really easy.
First, this is your activity:
package com.example.my_browser;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
public class MyActivity extends Activity {
/**
* Called when the activity is first created.
*/
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
WebView browser = (WebView)findViewById(R.id.browser);
browser.loadUrl("http://google.com"); //Replace google.com with you webapp's URL
}
}
This is your main.xml layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<WebView
android:id="#+id/browser"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</LinearLayout>
And you will need to request internet permission in AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET" />
I just tested this in an emulator and it works.
This answer is for iOS.
You can have an icon of your website on the home screen of the device without writing a line of code (no UIWebView, no native coding, no XCode).
Download iPhone Configuration Utility from http://www.apple.com/support/iphone/enterprise/
Start iPhone Configuration Utility and from the left menu select "Configuration Profiles"
In the General section of your new profile fill out the Name (MyWebsite app) and identifier (com.mycompany.coolapp). You can add also organization name and description.
Scroll down and select Web Clips section.
In the Label field you can enter the name that will be visible on the home screen.
URL will be the URL of your web site / web app.
Select the icon to be used as a home screen icon. Use at least 114x114 pixel resolution.
If you select "Full screen", the navigation bar and the address bar of Safari will be hidden when you launch your web app, so you can have a real "app".
Click on the "Export" button. You can decide whether to sign your profile (will be visible by the end user when he installs your profile).
Save the .mobileconfig file and upload it to your web server or send to your end users via mail.
When the end user opens the .mobileconfig file on his device, the system will ask him to install the configuration profile. After the installation a home screen icon will be created that points to your web site.
Update as of 2017
iPhone Configuration Utility has been replaced by Apple Configurator that you can download free from App Store. You can create a new Configuration Profile the same way as described for Apple Configurator, selecting File -> New Profile in the app.
edit 2
As #MrTJ said in the comments. Apparently Apple won't let you have a simple "website wrapper" application. So your only options would be porting Ruby, like the rest of my answer describes, porting the application natively, or doing a web app like #MrTJ describes in his answer. Porting it natively, supported by RESTlike web services, would probably be the best solution. Web Apps are nice, but native applications are usually nicer. It depends on what kind of user experience you want to provide.
end edit 2
edit 1
I need to read more carefully. I answered your question assuming you wanted to embed the application, without needing to access the internet. If that is NOT what you are trying to do, then it is definitely possible.
Just make an application that has a webview and loads the base URL for the site. You will probably want to do a special version of the site that ALWAYS has back buttons etc, so the user can never get stuck in a corner of your site (since you want the navbar hidden).
Also, personally I would not do this, you can, but you probably shouldn't. You will need to handle what to do when the user does not have an internet connection. And you may make them less than happy when they (potentially) paid for an application that they can't use everywhere. Native Applications tend to sell/perform much better.
end edit 1
My Personal Reaction to This Question
Cool Question. Personally I am not a fan or Ruby or Rails (I'm a bit more of a Python guy, but Python is actually why I know anything about this situation), but this is a pretty cool problem regardless.
Questions to ask yourself
Is this possible? Probably
Is it a good idea? Probably Not
Is it going to be worth the effort? Probably Not
And most importantly, will Apple let you sell it? ....Maybe, but for something like this, you won't know till you try....
What you Need
A WebView that uses a protocol to talk to your native application. This would be like the URL hash tag hack used to talk to an iFrame in a browser, or the protocol that PhoneGap uses to communicate with it's WebView
Embedded version of the Ruby Interpreter. People have been doing this on iOS with both the Python and JavascriptCore interpreters. Some people will try to tell you Apple won't let you do this, but that is no longer true. You will need to compile Ruby specifically for iOS, this will probably be annoying, but I bet if you base your implementation on the Python/Javascript implementations, you could eventually get it working.
edit
Another SO question/answer with relevance to this answer
Embed a JavaScript engine in an iOS application
end edit
Embedded version of Rails... Good luck :)
Method of triggering the Rails app without a web server (you probably can't run apache locally on an iPhone (would be difficult and would probably crash immediately), and definitely not on Android). You will either need to trigger each view manually somehow, piping the output to either a string or a file, and load that string (HTML) or file into the WebView
Method of triggering navigation in the Rails application. This will require catching link presses from the WebView (you can watch for the URL changing on iOS), and triggering the proper Rails view to produce its HTML.
Problems
Ruby and Rails are both VERY HEAVY. Most implementations I have seen require at least 256mb of RAM, iOS will instantly kill your application if it tries using this much memory at startup. Android will probably handle it far less gracefully and just crash unexpectedly at some point in the application run.
Android does not run Native Compiled code. This means you will need to run JRuby, which will leave you with an interpreted language running in an interpreted language (read as, Slow As Hell On a Mobile Device).
This will require writing MORE Ruby, some Javascript, and MORE Java or Objective-C. So in other words, Don't. Figure out what your application does, and port it.
Key Learning
This is will probably take way more effort than any sane developer would ever want to spend on a 'simple web application'. You will be far better off learning Native development, since that will be required to get this job done anyway.
Yes, for iOS simply load a UIWebView fullscreen and change the UIWebView's current URL to whatever the location of your web-app is. launching UIWebview with specific url
I don't know anything about android but apparently it's the same process... Here ya go: How to set url on WebView from a xml layout file on Android?
To communicate between iOS app and your website you can use stringByEvaluatingJavaScriptFromString mentioned here: Passing Javascript Variable to Objective-C
To do this with Android refer to the other answers to this question where they have already listed the code in their answer.

Extend my android app in different APK

I am developing an application that should be extendable
I want the user to install the base app and then extend it by installing extension packs (different APKs) or plug-ins (like go launcher and theme-packs or add-on widgets)
The only thing I could find is using library project to share the code but that doesn't fit my needs. Can someone explain how its done?
[edit]
To be more specific, here is what I want to do:
I have a set of animated scenes, effects and transitions
animated scene is a combination of code and resources
The user can select the 1st scene, 2nd scene etc..
I wish to be able to add more scenes but I don't want to include them all in one APK
I want to let the user download scenes of his choice.
To build this type of interaction, ContentProvider will be your friend. There are two options I can think of to build this type of system, depending on which direction you would like information to flow.
Option 1: Single ContentProvider in main application
Define a ContentProvider in your main application, which creates an external interface for other applications to read/write data to a common location. This provider maintains access to the scene data files/database your application needs.
Each subsequent plugin application accesses the main ContentProvider (and also warns the user if they run a plugin but haven't installed the main app yet) and installs its specific content by writing it to the ContentProvider. In this way, each plugin is designed to act as an "installer", meaning the user has to download and run the plugin from Market to install the scene content.
Option 2: Each "Plugin" application has its own ContentProvider
This option is the reverse of the above. Define a ContentProvider with a consistent interface in each plugin application and have a method from the main application that scans the system for new plugins (this can be done via PackageManager) and reads the data from each provider into its main local store.
The difference here is that the user won't have to run each plugin package, because the main application will take care of getting the data. However, there's more complexity in defining multiple providers. For instance, you have to make sure that, even if each provider has the same basic interface, they cannot have a single common authority, so you will have to scan the system for package names like your own and resolve the providers based on that information.
Editorial
Having said that, I feel I should mention that I don't believe this is a good method of providing content to your users. My personal feeling on the subject is this method pollutes the user's devices with application icons that do them no good, and it's difficult to hide that kind of thing on the mobile device. A simpler, and much cleaner approach to this would be to store your "add-on" content on a server (AWS services like S3 and SimpleDB are practically free) and use a service like Google's In-App Billing to let your users purchase the new content and download it directly into the single application rather than having them go back to Market and purchase more apps.
Hope that Helps!
I have a set of animated scenes, effects and transitions animated scene is a combination of code and resources The user can select the 1st scene, 2nd scene etc..
If the "animated scenes" are activities. your add-on APKs simply publish their own sets of activities, and you use PackageManager to determine which of your plugins are installed and how to use them.

Categories

Resources