Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4android > Basic4android Getting started & Tutorials
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Basic4android Getting started & Tutorials Android development starts here. Please do not post questions in this sub-forum.

SVN (source control) and Basic4android

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-26-2011, 01:06 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,689
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default SVN (source control) and Basic4android

Large projects and especially projects maintained by a group of developers usually require a source control system.
Using SVN with Basic4android is quite straightforward with a client tool such as TortoiseSVN. If you are familiar with SVN then the only thing you should remember is to add the Objects folder to svn:ignore as this folder holds temporary files and builds created during compilation.

If you are completely new to SVN then I recommend you to start by reading some material about SVN. A very good tutorial is available here: Version Control with Subversion

In this tutorial we will set a local SVN server and manage a project using TortoiseSVN client.

SVN is made of two main components. The server and the clients.
The server can be installed locally or on a different computer.
VisualSVN is the recommended SVN server for windows. It is easy to manage and is free.
Download and install VisualSVN.

Download and install TortoiseSVN. This is the client (it is also free).
The installation requires restarting Windows. So be patient...

We will now add the CurrencyConverter project to SVN.
You can add a different project in a similar manner. Please backup your project before adding it.
Run VisualSVN.
Create a new repository named 'main', with the default layout.
Create a new user.

Under the trunk folder create a folder named CurrencyConverter.



In VisualSVN right click on CurrencyConverter and choose Copy URL to clipboard.

Open Windows Explorer and navigate to your project folder.
Right click and choose SVN Checkout.
Paste the URL in the repository field.
Make sure that the checkout directory is correct and doesn't include the project name twice.



If this is the first time you connect with the local server then you will see a warning message about the certificate. Press on the Accept Permanently button.

After the checkout all the project files and folders should appear with a question mark icon as they are missing from the repository.



The next step is to add the Objects folder to the 'ignore' list. The Objects folder should not be controlled as it only* contains files generated during compilation (*the icon file is also stored inside. In order to keep things simple I recommend you to manage the icon manually).

Right click on Objects folder and choose Add to ignore list:


Now we should add the code files and the Files folder to SVN.
Mark these items and choose Add:


Right click on CurrencyConverter folder and choose SVN Commit to commit the changes:



The result should look like:



This means that the code files and Files folder are updated, and Objects is ignored.

Your project is now managed by SVN

SVN is very powerful and will allow you to easily track changes and compare the current version with previous versions. It is your responsibility to commit your changes from time to time.

If users are interested with auto-committing the project every x hours then I will explain how to accomplish it with an additional script.
Reply With Quote
  #2 (permalink)  
Old 10-29-2011, 01:06 PM
Basic4ppc Expert
 
Join Date: May 2008
Location: Italy
Posts: 599
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Very nice Erel. Great TIP!

Just got some free time to set it up. It works very nice. I just love the diff-viewer.

If would be great if one could execute the SVN-commit command from within B4A.
__________________
rgds,
moster67

Last edited by moster67 : 10-29-2011 at 01:10 PM.
Reply With Quote
  #3 (permalink)  
Old 05-01-2012, 07:05 AM
Penko's Avatar
Basic4ppc Veteran
 
Join Date: Feb 2012
Location: Plovdiv, Bulgaria
Posts: 214
Send a message via Skype™ to Penko
Default

Let me continue the question.

First of all, great tutorial, you explain everything in a very straightforward way.

My question is, imagine that me and my partner are working simultaniously, what is the behavior of B4A? I open a new project, setup SVN and do the following:
- add activity 1
- add activity 2
- add activity 3

Then my partner adds activity 4.

What I suppose is that I will see this activity the next time I open the project in B4A. But what if he does some changes to the three activities I've added. Will I see them?

I am asking because we may be writing a program in a team. It's still an idea but may happen and I have to do some researching in advance.
__________________
HTC Desire running Android 2.2
Reply With Quote
  #4 (permalink)  
Old 05-01-2012, 07:19 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,689
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

This is exactly the purpose of SVN. It shows you and lets you easily synchronize updates done by other members. Whether these are new files or existing files.
Reply With Quote
  #5 (permalink)  
Old 05-02-2012, 11:02 AM
Penko's Avatar
Basic4ppc Veteran
 
Join Date: Feb 2012
Location: Plovdiv, Bulgaria
Posts: 214
Send a message via Skype™ to Penko
Default

But is it dynamic? If we are working simultaniously without reopening the project, will b4a update the project so if I click the tab my partner has worked on, will I see the changes instantly? I am not sure how the IDE handles files, so that's why I am asking.

Sent from my HTC Desire using Tapatalk
__________________
HTC Desire running Android 2.2
Reply With Quote
  #6 (permalink)  
Old 05-02-2012, 11:54 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,689
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

No. You will need to first use the SVN update feature and then reopen the project.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
B4A-Bridge source code Erel Basic4android Getting started & Tutorials 7 04-11-2012 08:24 PM
Gird Control in Basic4Android junaidahmed Basic4android Updates and Questions 2 12-20-2010 02:43 AM
Tippy v.1.0 [open source] N1c0_ds Share Your Creations 5 04-24-2009 02:51 PM
Chat control source! Byak@ Basic4ppc Wishlist 1 11-21-2008 12:29 PM
The best folder for your source code Erel Code Samples & Tips 0 05-01-2007 07:17 PM


All times are GMT. The time now is 09:57 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0