Play framework combining two Play application into one - java

I have two application written in playframework.
I would like to join one to another.
I have one database, and I would like to share my login classes between thems.
Applications have difrent names used for classes, methods, variables.
How can I achive it?
Should I create jar version and try to join them.
Or Should I move code from one app to another with new package name like application name
But what about shared views or main controller and configuration files
Please give me some advice.

One project make as sub-project of another one.
See this link:
https://www.playframework.com/documentation/2.1.x/SBTSubProjects

Related

How to use the atom text editor with git -java-

I am trying to use atom with git to work on a coding project with some class mates, for this particular project we are supposed to practice making different classes. I just pulled the most recent version of the project from git and I now see that they were successfully able to create new classes/tab-things but have it still within the main file. How do I do something like this in atom? I can't ask them because they use a different ide.
In the picture you can see different classes in drop-downs but its still within "project2" - how do I do this for another class and have it in a new drop down and upload it to git?
image of what i'm looking at
From the screen shot, those dropdowns appear to simply be diffs from the git log. So if you want your changes to appear in a similar fashion, you'll need to create the classes (or additional files) and commit/push them.

how to add a new DAO class in greendao without overwriting the existing structure

I have just been doing a quick crash course in greenDAO because I have taken over development of an app that is heavily dependent on greenDAO . Basically I need to add an extra table and I figured I cant add another table to a DAO class that already has another table defined in it , so I would like to know how I can add another DAO class so that I may be able to add the other table
See http://greenrobot.org/greendao/documentation/modelling-entities and http://greenrobot.org/greendao/documentation/how-to-get-started/
You need to find generator in your sources which looks like https://github.com/greenrobot/greenDAO/blob/master/DaoExampleGenerator/src/de/greenrobot/daogenerator/gentest/ExampleDaoGenerator.java. Modify, compile and run the generator, pointing directory containing existing xxxDAO.java files as an output dir. Generator will update existing files preserving your custom methods in xxxDAO.java file (if they are placed properly between special comments, see docs). And new xxxDAO files will be added.

How to include app dependency to Android studio project?

I may be using the wrong terminology for what I am really asking. But let me describe what I need.
I have two separate apps, one was made first and the second was made later, but the second app has files that I have copy+pasted over from the first app. Now, there are separate apps and projects. But I was wondering if there is a way to to have 1 project but with 2 apps in it and be able to build/compile them as separate apps? This is so that I wouldn't need to have multiple copies of the same Java code in 2 separate places. I want to have the second app dependent on the first one, so that if I were to make a change I wouldn't need to make a change in multiple places.
I've googled and search for my problem, but I get solutions for including/adding 3rd party libraries and dependencies (which I already know how to do), but that's not what I need.
EDIT: I would need them to generate 2 separate APK files.
Since you seem to not want to create your first project as a library, you could set up symbolic links from your second app to the source code of your first. They would remain two projects, and the second would link to the source code in the first.
Any shared code you changed in one, would be reflected in the other.
I'm assuming you are using Windows, so check this link out.
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365680(v=vs.85).aspx
OSX Link: https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man7/symlink.7.html
As requested. GIT can save the value of symbolic links. With some configuration it can follow them if that's what's needed. Also, you could use a branch in git to accomplish the separation of projects with a shared branch.
How does git handle symbolic links?
Links on branches:
https://github.com/Kunena/Kunena-Forum/wiki/Create-a-new-branch-with-git-and-manage-branches
http://git-scm.com/docs/git-branch

Can Google Checkout/Wallet have two notification callbacks setup?

On my website I'm using Java Tomcat, and I have an application war containing webpages for my product and code for buying the product integrated with Google Wallet.
I have now added a new product with its associated webpages deployed in another war file. So I have one war file per product, but now when trying to add code for buying product 2 I realize that I need to setup Google notification callback to point to this war in my google preferences, but I cannot because it is already pointing to war 1.
So is there any way to setup two google notiifcation callbacks, or do I need to reorganize my code so that I either merge the two war files into one , or probably better create a third war containing all purchasing code used by both products.
You can't - as you already know, callback api urls are set in your account, and you're only provided one.
Aside from (or instead of) creating yet another (aka "third"), perhaps tagging your orders by using merchant-private-data and/or merchant-private-item-data could be viable.
This way you can "segment" the orders (or items) appropriately when receiving new-order-notification.
Hth....
Do you have a site per product? You could also create multiple Checkout accounts, one for each product.

Howto access the main res/layout/ files from a sub package?

This is also a design question. I don't know the best way to design having many activities and how to break them up into packages while still accessing the apps resources.
I have an application which allows a user to login and access a tabbed activity which gives access to many modules. If they click a module they will load the module which will in turn contains a tabbed activity.
Currently i have 3 packages within this app:
com.appname.app (many activities i'd like to split up, login, module list etc)
com.appname.app.XML (xml handlers)
com.appname.app.Utils (static util classes etc)
I'd like to add a new package to contain all my modules so something like
com.appname.app.Modules ( or even a seperate package for EACH module)
But i can then no longer access the main apps resources without referring to them with a full package name such as setContentView(com.appname.app.R.layout.channel_list);
Obviously within any com.appname.app activities i just reference the resources such as layouts via setContentView(R.layout.channel_list);.
I'd have thought that a sub package (sub directory) should have access to a parent's resources without having to use com.appname.app.R.layout.channel_list instead of R.layout.channel_list. Which is why i'm assuming something is wrong with my design
The same issue goes for accessing string, drawable etc resources...
Im sure this is something very basic I'm missing. I've tried manually importing the "parent" package and that didn't work either.
is this how i should be doing things? or should i somehow be creating the resource files within each module package? or there another way i should be handling the design/split up of my app?
Since the Android pre-compiler would compile all references to a R.class file and place in in the main package there's no better way than to explicitly import the resources wherever you want to use them
import com.appname.app.R;
so that no full qualifier is needed.

Categories

Resources