Skip to content

Commit 7179101

Browse files
Update to Android Studio
Complete new application from scratch.
1 parent fe53bc3 commit 7179101

File tree

316 files changed

+5294
-5500
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

316 files changed

+5294
-5500
lines changed

.gitignore

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# built application files
2+
*.apk
3+
*.ap_
4+
5+
# files for the dex VM
6+
*.dex
7+
8+
# Java class files
9+
*.class
10+
11+
# generated files
12+
bin/
13+
gen/
14+
15+
# Local configuration file (sdk path, etc)
16+
local.properties
17+
18+
# Android Studio
19+
.idea/
20+
.gradle
21+
/*/local.properties
22+
/*/out
23+
/*/*/build
24+
/*/*/production
25+
*.iml
26+
*.iws
27+
*.ipr
28+
*~
29+
*.swp

BeRoadsProject/BeRoads/build.gradle

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
buildscript {
2+
repositories {
3+
mavenCentral()
4+
}
5+
dependencies {
6+
classpath 'com.android.tools.build:gradle:0.4.2'
7+
}
8+
}
9+
apply plugin: 'android'
10+
11+
dependencies {
12+
compile fileTree('libs')
13+
compile 'com.android.support:support-v4:13.0.0', 'com.google.android.gms:play-services:3.1.36'
14+
}
15+
16+
android {
17+
compileSdkVersion 17
18+
buildToolsVersion "17.0.0"
19+
20+
signingConfigs {
21+
debug {
22+
storeFile file("key_tof162debug")
23+
24+
}
25+
}
26+
27+
defaultConfig {
28+
minSdkVersion 14
29+
targetSdkVersion 16
30+
}
31+
}
2.28 KB
Binary file not shown.
186 KB
Binary file not shown.
47.1 KB
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.profete162.WebcamWallonnes"
4+
android:versionCode="29"
5+
android:versionName="3.03B1">
6+
7+
<uses-sdk
8+
android:minSdkVersion="14"
9+
android:targetSdkVersion="16"/>
10+
11+
<uses-permission android:name="android.permission.INTERNET"/>
12+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
13+
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
14+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
15+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
16+
<permission
17+
android:name="com.profete162.WebcamWallonnes.permission.MAPS_RECEIVE"
18+
android:protectionLevel="signature"/>
19+
<uses-permission android:name="com.profete162.WebcamWallonnes.permission.MAPS_RECEIVE"/>
20+
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
21+
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
22+
23+
<permission android:name="com.profete162.WebcamWallonnes.permission.C2D_MESSAGE"
24+
android:protectionLevel="signature" />
25+
<uses-permission android:name="com.profete162.WebcamWallonnes.permission.C2D_MESSAGE" />
26+
27+
<uses-feature
28+
android:glEsVersion="0x00020000"
29+
android:required="true"/>
30+
31+
32+
<application
33+
android:allowBackup="true"
34+
android:icon="@drawable/ic_launcher"
35+
android:label="@string/app_name"
36+
android:theme="@style/AppTheme">
37+
<activity
38+
android:name=".MainActivity"
39+
android:theme="@style/AppTheme"
40+
android:label="@string/app_name">
41+
<intent-filter>
42+
<action android:name="android.intent.action.MAIN"/>
43+
44+
<category android:name="android.intent.category.LAUNCHER"/>
45+
</intent-filter>
46+
</activity>
47+
<activity
48+
android:name=".NotifConfigActivity"
49+
android:label="@string/app_name">
50+
</activity>
51+
<receiver
52+
android:name=".MyBroadcastReceiver"
53+
android:permission="com.google.android.c2dm.permission.SEND" >
54+
<intent-filter>
55+
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
56+
<category android:name="com.profete162.WebcamWallonnes" />
57+
</intent-filter>
58+
</receiver>
59+
60+
61+
<meta-data
62+
android:name="com.google.android.maps.v2.API_KEY"
63+
android:value="AIzaSyCSeALfuUrujaNPWh6Jy4lMeVb3clh5OMw"/>
64+
</application>
65+
66+
</manifest>
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
package com.profete162.WebcamWallonnes;
2+
3+
import android.content.Intent;
4+
import android.net.Uri;
5+
import android.os.Bundle;
6+
import android.text.Html;
7+
import android.view.LayoutInflater;
8+
import android.view.View;
9+
import android.view.ViewGroup;
10+
import android.widget.ImageView;
11+
import android.widget.TextView;
12+
13+
import com.profete162.WebcamWallonnes.Utils.NumberedFragment;
14+
15+
public class AboutFragment extends NumberedFragment {
16+
17+
18+
@Override
19+
public void onResume() {
20+
POSITION=4;
21+
super.onResume();
22+
}
23+
24+
@Override
25+
public View onCreateView(LayoutInflater inflater, ViewGroup container,
26+
Bundle savedInstanceState) {
27+
return inflater.inflate(R.layout.fragment_about, null);
28+
}
29+
30+
public void onActivityCreated(Bundle savedInstanceState) {
31+
super.onActivityCreated(savedInstanceState);
32+
setPeopleToView(R.id.people1, "Android: Waza_Be", R.drawable.ic_p_wazabe, "Your Android apps creator <a href=\"mailto:[email protected]\">[email protected]</a>", "https://plus.google.com/108315424589085456181/posts");
33+
setPeopleToView(R.id.people2, "Web: Quentin Kaiser", R.drawable.ic_p_qkaiser, "Student in computer sciences @ UCL . Hacker and python addict", "http://www.quentinkaiser.be");
34+
setPeopleToView(R.id.people3, "Design: julien Winant", R.drawable.ic_p_harkor, "Je r&eacute;alise des interfaces interactives modernes et efficaces", "http://harkor.be/");
35+
setPeopleToView(R.id.people4, "iPhone: Lionel Schinckus", R.drawable.ic_p_lio, "iOS developer", "https://twitter.com/ValCapri");
36+
37+
38+
}
39+
40+
private void setPeopleToView(int layout, String title, int img, String desc, final String link) {
41+
View view = this.getView().findViewById(layout);
42+
43+
view.setOnClickListener(new View.OnClickListener() {
44+
45+
@Override
46+
public void onClick(View v) {
47+
if (!link.contentEquals(""))
48+
startActivity(new Intent(Intent.ACTION_VIEW,
49+
Uri.parse(link)));
50+
}
51+
});
52+
53+
ImageView iv = (ImageView) view.findViewById(R.id.iv);
54+
iv.setImageResource(img);
55+
56+
TextView tvName = (TextView) view.findViewById(R.id.tName);
57+
tvName.setText(title);
58+
59+
TextView tDesc = (TextView) view.findViewById(R.id.tDesc);
60+
tDesc.setText(Html.fromHtml(desc));
61+
}
62+
63+
64+
}
65+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
package com.profete162.WebcamWallonnes.Adapter;
2+
3+
import android.app.Activity;
4+
import android.content.Context;
5+
import android.view.LayoutInflater;
6+
import android.view.View;
7+
import android.view.ViewGroup;
8+
import android.widget.ArrayAdapter;
9+
import android.widget.ImageView;
10+
import android.widget.TextView;
11+
12+
import com.profete162.WebcamWallonnes.R;
13+
14+
15+
public class MenuAdapter extends ArrayAdapter<String> {
16+
17+
String[] list;
18+
String[] icons;
19+
Context mContext;
20+
21+
public MenuAdapter(Context context, int textViewResourceId, String[] objects) {
22+
23+
super(context, textViewResourceId, objects);
24+
this.icons = context.getResources().getStringArray(R.array.menuIcons);
25+
this.mContext = context;
26+
list = objects;
27+
}
28+
29+
@Override
30+
public View getView(int position, View convertView, ViewGroup parent) {
31+
View row = convertView;
32+
33+
if (row == null) {
34+
35+
LayoutInflater inflater = ((Activity) mContext).getLayoutInflater(); // we get a reference to the activity
36+
row = inflater.inflate(R.layout.row_menu, parent, false);
37+
}
38+
39+
TextView tTitle = (TextView) row.findViewById(R.id.tTitle);
40+
ImageView icon = (ImageView) row.findViewById(R.id.icon);
41+
42+
tTitle.setText(list[position]);
43+
icon.setImageResource(mContext.getResources().getIdentifier("ic_c_"+icons[position], "drawable"
44+
, mContext.getPackageName()));
45+
46+
return row;
47+
48+
}
49+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
package com.profete162.WebcamWallonnes.Adapter;
2+
3+
/**
4+
* Created by 201601 on 18/06/13.
5+
*/
6+
7+
import android.text.format.DateUtils;
8+
import android.view.LayoutInflater;
9+
import android.view.View;
10+
import android.widget.ImageView;
11+
import android.widget.TextView;
12+
13+
import com.google.android.gms.maps.GoogleMap;
14+
import com.google.android.gms.maps.model.Marker;
15+
import com.koushikdutta.urlimageviewhelper.UrlImageViewCallback;
16+
import com.koushikdutta.urlimageviewhelper.UrlImageViewHelper;
17+
import com.profete162.WebcamWallonnes.R;
18+
import com.profete162.WebcamWallonnes.Utils.Utils;
19+
20+
public class PopupTrafficAdapter implements GoogleMap.InfoWindowAdapter {
21+
LayoutInflater inflater = null;
22+
23+
public PopupTrafficAdapter(LayoutInflater inflater) {
24+
this.inflater = inflater;
25+
}
26+
27+
@Override
28+
public View getInfoWindow(Marker marker) {
29+
return (null);
30+
}
31+
32+
@Override
33+
public View getInfoContents(Marker marker) {
34+
String[] text = marker.getTitle().split(";");
35+
View popup;
36+
switch (text[0].charAt(0)) {
37+
case 'W':
38+
popup=inflater.inflate(R.layout.popup_webcam, null);
39+
TextView tTitle = (TextView) popup.findViewById(R.id.tTitle);
40+
tTitle.setText(text[2]);
41+
return (popup);
42+
case 'R':
43+
popup=inflater.inflate(R.layout.popup_radar, null);
44+
TextView tDesc = (TextView) popup.findViewById(R.id.tDesc);
45+
tDesc.setText(marker.getSnippet().split(";")[0]);
46+
TextView tDist = (TextView) popup.findViewById(R.id.tDist);
47+
tDist.setText(text[2]);
48+
TextView tName = (TextView) popup.findViewById(R.id.tName);
49+
tName.setText(text[1]);
50+
return (popup);
51+
default:
52+
popup=inflater.inflate(R.layout.popup_traffic, null);
53+
TextView tv = (TextView) popup.findViewById(R.id.tName);
54+
tv.setText(text[2]);
55+
tv = (TextView) popup.findViewById(R.id.tDesc);
56+
tv.setText(marker.getSnippet());
57+
return (popup);
58+
}
59+
60+
61+
62+
63+
}
64+
65+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
package com.profete162.WebcamWallonnes.Adapter;
2+
3+
import android.content.Context;
4+
import android.view.LayoutInflater;
5+
import android.view.View;
6+
import android.view.ViewGroup;
7+
import android.widget.ArrayAdapter;
8+
import android.widget.TextView;
9+
10+
import com.profete162.WebcamWallonnes.R;
11+
import com.profete162.WebcamWallonnes.RadarFragment;
12+
import com.profete162.WebcamWallonnes.TrafficFragment.Traffic;
13+
import com.profete162.WebcamWallonnes.Utils.Utils;
14+
15+
import java.util.ArrayList;
16+
17+
18+
public class RadarAdapter extends ArrayAdapter<RadarFragment.Item>{
19+
20+
private LayoutInflater myLayoutInflater;
21+
protected ArrayList<RadarFragment.Item> items;
22+
double currentLat; double currentLon;
23+
24+
public RadarAdapter(Context context, int textViewResourceId, ArrayList<RadarFragment.Item> list, LayoutInflater layoutInflater, double currentLat, double currentLon) {
25+
super(context, textViewResourceId, list);
26+
this.myLayoutInflater = layoutInflater;
27+
this.items = list;
28+
this.currentLat = currentLat;
29+
this.currentLon = currentLon;
30+
}
31+
32+
33+
@Override
34+
public View getView(int position, View convertView, ViewGroup parent) {
35+
// TODO Auto-generated method stub
36+
//
37+
38+
View row = convertView;
39+
40+
if (row == null) {
41+
row = myLayoutInflater.inflate(R.layout.row_radar, parent, false);
42+
}
43+
44+
RadarFragment.Item item=items.get(position);
45+
46+
TextView tLimit = (TextView) row.findViewById(R.id.tLimit);
47+
tLimit.setText(""+item.getSpeedLimit());
48+
49+
TextView tType = (TextView) row.findViewById(R.id.tType);
50+
tType.setText(item.getType());
51+
52+
TextView tDesc = (TextView) row.findViewById(R.id.tDesc);
53+
tDesc.setText(item.getAddress());
54+
55+
TextView tDis = (TextView) row.findViewById(R.id.tDist);
56+
int iDistance = (int) Utils.getDistance(currentLat, currentLon, item.getLat(), item.getLng())/100;
57+
tDis.setText((double) iDistance / 10 + "km");
58+
59+
return row;
60+
}
61+
}
62+
63+

BeTraffic/src/com/profete162/WebcamWallonnes/adapter/SectionedAdapter.java BeRoadsProject/BeRoads/src/main/java/com/profete162/WebcamWallonnes/Adapter/SectionedAdapter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.profete162.WebcamWallonnes.adapter;
1+
package com.profete162.WebcamWallonnes.Adapter;
22

33
import java.util.ArrayList;
44
import java.util.List;

0 commit comments

Comments
 (0)