GitHub collaboration using Android Studio - java

My friends & I are trying to collaborate via GitHub on a basic Android- Studio project. I know how to connect our GitHub accounts through the website and through Android- Studio, that's not the issue. In other words, we've tested out test comments to commit to see if it goes through, it does successfully. The changes are reflected on the website when navigating to the appropriate .java file (i.e. the test comment).
Which files should & shouldn't be pushed to reduce the chances of errors being thrown at us? My assumption is, some of the files that are being pushed don't need to be pushed to everyone because it pertains to configurations that's related to their computer. For example, if someone decides to add a search bar and that person commit/pushed his code, how can I pull that in a way where what he's contributed appears on my machine without running the risk of tampering with my configurations?

Github defaults into a master branch (i.e. everytime you commit and push your updated project will be saved into this branch). However, Github enables you to create separate branches, which I believe is the solution you are looking for. If you want to make edits to your project but you are unsure you want to have those edits show in your actual project, create a separate branch and make those edits there. Note that Github enables you to merge branches.

Related

Running A Java Eclipse Project on a Cloud-based Server with external Libraries

I hope this is the right place to post this question. The web applications stack exchange did not look suitable based on the other questions asked on there so I guessed this might be the best place to put this question.
I have a java eclipse project that works as I would like it which takes in an image locally from the adjacent file path and performs the required action on this image before returning a double value at the end after all the calculations. To do these calculations I use the OpenCV library which is essential to the core functionality of the application.
The issue I am having is to deploy this application so that the the application when it receives a request will take in an image (preferably as a .jpg but this can be changed if absolutely essential) and then after the application has carried out the required task send back the resulting number. In future this will be sent and received by an Android app which will just take the photo, compress it and send it away before receiving and displaying the answer but for now I'm just trying to get my project onto an accessible server.
I have tried to use Heroku and followed their tutorials and instructions which encourages the use of Maven but I could not properly insert the dependencies for my project as it used an external jar. I spent a lot of time checking through the various solutions online to this issue but a lot of them felt like workarounds which only worked in some cases and none were working for me. I am open to using this again if there is an elegant solution that is simple to follow.
The main sections of this question that I am asking is for the simplest way to take my working eclipse project which uses an external library, modify it to take in an image via server request and then send back a number result. I also would like a suggestion as to which cloud-based service would be suitable for this project and allow me simply to put my code on their service and allow a test user to run this code whenever I want with reasonable availability.
Sorry for the long-winded explanation and I hope I have provided enough information. I have been trying to work out how to do these things with the help of tutorials and suggestions for a few weeks now but have no previous experience with making a web server as everything I have created has been a local program.
Thanks for your help and suggestions

track changes in eclipse

I have eclipse installed on a local computer, and am working on a project by myself. No one else is collaborating on the coding, I am doing it all myself.
Sometimes, I get ambiguous error messages in my spring mvc app when I run it on tomcat server using eclipse's run as...run on server command. For example, there is sometimes NO stack trace. In those cases, I would like to at least be able to see when each file in the app was last saved, so that I can try to figure out what I changed since the last time the app ran successfully. Ideally, I would like to also be able to see what changes I made to specific files.
Can anyone show me how to accomplish this?
Eclipse has Local History feature: try Team > Show Local History from context menu.
But I recommend you to use some version control system (svn, git) even if you work on your project alone.

Differentiating debug and production build of an Android app

I recently started learning about Android app development. It's also my first experience with the Java language.
There are some debugging tools that I want to incorporate into my app development in a form of Java package dependency. For obvious reasons, I would like to include it only for debug builds.
In iOS, we can use build configuration to link with debugging libraries only for debug builds, and use macros to remove parts of code that deals with debugging. This makes it really easy to switch between debug and production builds. Anyway to achieve the same for Android?
So far, the closest I got is using Maven profiles to overwrite properties files, which gets loaded by the application, but this requires that the debugging libraries are still imported.
To clarify my question, here is what I want to do:
I built a library that will let you browse the SQLite database on your browser. It's really useful for debugging purposes, but I don't want to ship my app with the library.
Another purpose is to use HockeyApp. HockeyApp provides two features: Update notification, and crash reporting. I need three different builds for this to work:
Production: Crash reporting On, Update notification Off
Beta: Both On
Debug: Both Off
In the manifest's <application>, you can set the debuggable attribute. Eclipse does this for you automatically if you omit the attribute. Debug builds have debuggable=true, well exported builds have debuggable=false.
This affects Log.d, and you can conditionally check in code using the following:
boolean isDebuggable = (0 != (getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE));
In addition to Maven, one way is to use a dependency injector like Dagger
By building on standard javax.inject annotations (JSR-330), each class is easy to test. You don't need a bunch of boilerplate just to swap the RpcCreditCardService out for a FakeCreditCardService.
Dependency injection isn't just for testing. It also makes it easy to create reusable, interchangeable modules. You can share the same AuthenticationModule across all of your apps. And you can run DevLoggingModule during development and ProdLoggingModule in production to get the right behavior in each situation.
One way to solve this is to check the return value of PackageManager#getInstallerPackageName. It returns null if the apk was installed manually through adb, through a web page, or through a service like HockeyApp. In fact, I recently added a similar check to our sdk, see this commit.
Note that this solution is only reliable if you only distribute your (paid) app though Google Play. Last time I checked, alternative stores like the Amazon App Store or AndroidPIT were not setting the installer source (it is possible to set it since API level 11, see PackageManager#setInstallerPackageName).
Another option is to check the package name at runtime. For your beta builds, you would append ".beta" to the package name and then check for this suffix to enable in-app updates or debug stuff. You can do this by moving your code base into a library project and set up two app projects that reference this library project: one for the store app, one for the beta app. Our use aapt with the option --rename-manifest-package to change the package name of beta builds (see details here).
do you have use BuildConfig.DEBUG, this is created by android adt tool
/gen/BuildConfig

sipdroid - Another incoming call is not display while one is continue

I have installed SIPDROID. I made three account at sip2sip.
After that I have configured application using one of that account. Application works fine.
Question is: If I make multiple call to the same phone using SIP is there anyway to handle all calls at a same time?
Another incoming call is not displaying on mobile screen while first call is continue.
The first call getting picked up but what about the second call which is coming during first call.
Even second call is not displaying on the screen. Confused !!
Sipdroid that I what started with but after researching on it and from developers reviews I found that application has some missing functionality like multiple call and transferring calls etc...
I don't know but may who is expert in sip stack or have time to do can implement missing functionality but I am neither one of them so my desire to get an application that have all this functionality and by modifying it I can integrate into my application and csipsimple is the answer.
However its not easy job to build csipsimple into windows environment but there is hack how to do it. so carefully read its wiki about building project into window environment.
According to wiki you can build native library or you can go ahead without building the native library. I suggest for windows user to go with without building the native library.
If you have read wiki then in "without building the native library" section last line is like
"To get the .so files, download latest nightly build from nightly
build website and unpack the apk file (apk files are just zip files).
Then get lib/ARCH/.so files and copy it into CSipSimple
libs/ARCH/.so"
I have to clarify one important thing about that:
First get .apk file of csipsimple. The version of .apk file must same to download version of your csipsimple source code..
Here, you can see the source code version. Download the same version .apk and do further as described in wiki.
SipDroid supports only one line at all times. This means you cannot have conference calls. So to the question:
If I make multiple call to the same phone using SIP is there anyway to
handle all calls at a same time?
Nope, you cannot handle simultaneous calls at the same time. Fortunately there's another open source SIP Client that supports multiple lines - IMSDroid.
Though you can extend SipDroid to support multiple lines, that's a lot of effort. The main objects you have to pay attention to in order to support multiple lines are:
UserAgent, SipProvider (note that it's designed to support multiplexing/demultiplexing of SIP messages), JAudioLauncher and the Call object.
The bug you're describing with the second call not showing is not something I have witnessed. This could be due to your device setup, or due to customizations performed on the original code...
you can build the csipsimple easily in linux OS... All you have to do is just paste the download source link in linux commanpropmt and for windows you must have latest cygwin software to download or to build native library... Better option is to go for linux OS only...

updating JUST HTML files on Google App Engine

I have a Google App Engine Application, and as part of that Application I have my standard HTML pages, Home, ContactUs, Testimonials, Pricing ETC ETC, when users click on "login" or go to a specific URL eg (www.diarybooker.com/demo) it loads the actual application.
All these standard HTML files are fairly static files though, with analytics and SEO etc in them, however in order to update these currently I need to release a new version of my application every time.
Can anyone offer any advice as to how I can JUST update the HTML without having to release a new version of my application (especially if I am in the middle of a development cycle and don't want to branch just to update a contact number or fix an SEO issue etc)
It is entirely possible that I am actually using the system incorrectly and that I should be re-wiring things better/differently, but I cant find any information about how this SHOULD be setup, and Im not even sure what to search for either, so if anyone can at least point me in the direction of some information on this, I would be very greatful!!
By way of an alternative example, I have a friend who is running www.wineathome.org.uk and if you click on "attend a tasting" it moves off into http://wineathomeuk.appspot.com. Clearly this is not very clean and is also not the way to make it work, I could embed the application in an iframe, but is that really the way to go?!
You have your application code in source control, right? I'd suggest that you create a deployment directory and clone into it the version of the application that you want to have running on AppEngine. Then, copy into the deployment directory the versions of the HTML files that you want updated. Deploy away.
That is the only strategy that's going to work for you. The GAE deployment tool only deals with your application as a whole.
Looks like you have a couple of issues going on.
On the first issue as #AdamCrossland states you can use source control. I use git and create branches for my application at different versions. If you do that you can merge your updated HTML back into an older branch then update your application from that branch. That way your only changing the HTML files and leaving the application in it's current state. App Engine deploy is intelligent and will only upload the modified files. Doing this from Eclipse is a bit more difficult than from the CLI IMO, but YMMV.
The other issue of a friend clicking on attend a tasting routing the url to appspot is a bit harder to deal with unless some code is provided. I would think it is because the code is doing a redirect to a hard coded URL. I have several application mapped to a domains and none of them route to appspot unless I forced it to in order to use some functionality like HTTPS which only works on appspot.com. I personally try to avoid iframes it opens up an avenue for exploits.

Categories

Resources