Problem Installing Eclipse Google Android Plugin

When installing Eclipse Android Plugin according to the instructions in http://code.google.com/android/intro/installing.html   the installation halted and ended because of a connection error. As a lot of user have the same problem, a trick to solve that is below.

I have just changed the url of the site address in Eclipse Update section by deleting secure “s” in the url.

Previous:

https://dl-ssl.google.com/android/eclipse/

After:

http://dl-ssl.google.com/android/eclipse/

Strategy Pattern with C++


Vehicle.h

#ifndef VEHICLE_H_
#define VEHICLE_H_

#include "MovingBehavior.h"

class Vehicle
{
public:
Vehicle();
virtual ~Vehicle();
void virtual moveForward();
virtual MovingBehavior* getMovingBehavior();
virtual void setMovingBehavior(MovingBehavior* _movingBhv);

private:
MovingBehavior *movingBhv;
};

#endif /*VEHICLE_H_*/

Vehicle.cpp
#include "Vehicle.h"
#include <iostream>

using namespace std;

Vehicle::Vehicle()
{
}

Vehicle::~Vehicle()
{
}

MovingBehavior* Vehicle::getMovingBehavior(){
return movingBhv;
}

void Vehicle::setMovingBehavior(MovingBehavior* _movingBhv){
movingBhv = _movingBhv;
}

void Vehicle::moveForward(){
getMovingBehavior()->moveForward();
}

MovingBehavior.h
#ifndef MOVINGBEHAVIOR_H_
#define MOVINGBEHAVIOR_H_

class MovingBehavior
{
public:
MovingBehavior();
virtual ~MovingBehavior();
virtual void moveForward() = 0;
};

#endif /*MOVINGBEHAVIOR_H_*/

MovingBehavior.cpp
#include "MovingBehavior.h"
#include <iostream>

using namespace std;

MovingBehavior::MovingBehavior(){

}

MovingBehavior::~MovingBehavior(){
}

Car.h
#ifndef CAR_H_
#define CAR_H_

#include "Vehicle.h"

class Car : public Vehicle
{
public:
Car();
virtual ~Car();
virtual void moveForward();

};

#endif /*CAR_H_*/

Car.cpp
#include <iostream>
#include "Car.h"
#include "FourWheelMoving.h"

using namespace std;

Car::Car():Vehicle()
{
FourWheelMoving *fourWheelMoving = new FourWheelMoving;
setMovingBehavior(fourWheelMoving);
}

Car::~Car()
{
delete getMovingBehavior();
}

void Car::moveForward() {
getMovingBehavior()->moveForward();
}

Ginger.h
#ifndef GINGER_H_
#define GINGER_H_

#include "Vehicle.h"
#include "MovingBehavior.h"

class Ginger : public Vehicle
{
public:
Ginger();
virtual ~Ginger();

};

#endif /*GINGER_H_*/

Ginger.cpp
#include "Ginger.h"
#include "TwoWheelMoving.h"

Ginger::Ginger()
{
TwoWheelMoving *twoWheelMoving = new TwoWheelMoving;
setMovingBehavior(twoWheelMoving);
}

Ginger::~Ginger()
{
delete getMovingBehavior();
}

FourWheelMoving.h
#ifndef FOURWHEELMOVING_H_
#define FOURWHEELMOVING_H_

#include "MovingBehavior.h"

class FourWheelMoving : public MovingBehavior
{
public:
FourWheelMoving();
virtual ~FourWheelMoving();
virtual void moveForward();
};

#endif /*FOURWHEELMOVING_H_*/

FourWheelMoving.cpp
#include <iostream>

#include "FourWheelMoving.h"

using namespace std;

FourWheelMoving::FourWheelMoving()
{
}

FourWheelMoving::~FourWheelMoving()
{
}

void FourWheelMoving::moveForward(){
cout << "Moving four wheels" << endl;
}

#ifndef TWOWHEELMOVING_H_
#define TWOWHEELMOVING_H_

TwoWheelMoving.h
#include "MovingBehavior.h"

class TwoWheelMoving : public MovingBehavior
{
public:
TwoWheelMoving();
virtual ~TwoWheelMoving();
virtual void moveForward();
};

#endif /*TWOWHEELMOVING_H_*/

TwoWheelMoving.cpp
#include "TwoWheelMoving.h"
#include <iostream>

using namespace std;

TwoWheelMoving::TwoWheelMoving()
{
}

TwoWheelMoving::~TwoWheelMoving()
{
}

void TwoWheelMoving::moveForward() {
cout << "Moving two wheels" << endl;
}

Tester.cpp
#include <iostream>
#include "Car.h"
#include "Ginger.h"

using namespace std;
int main(int argc, char *argv[])
{

Car car;
Ginger ginger;
Vehicle* vehiclePtr = &car;

vehiclePtr->moveForward();

vehiclePtr = &ginger;

vehiclePtr->moveForward();

return 0;
}// end main