Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
b30cacb0
Commit
b30cacb0
authored
Mar 09, 2012
by
george dagkakis
Committed by
Georgios Dagkakis
Mar 12, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bin ignored
parent
62106fcb
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
79 additions
and
12 deletions
+79
-12
.gitconfig
.gitconfig
+3
-0
.gitignore
.gitignore
+1
-0
MobileEventGuide/res/layout/main.xml
MobileEventGuide/res/layout/main.xml
+24
-11
MobileEventGuide/res/values/strings.xml
MobileEventGuide/res/values/strings.xml
+1
-0
MobileEventGuide/src/mobile/event/org/MobileEventGuide.java
MobileEventGuide/src/mobile/event/org/MobileEventGuide.java
+50
-1
No files found.
.gitconfig
0 → 100644
View file @
b30cacb0
[user]
name
=
george dagkakis
email
=
gdagkakis@yahoo.com
.gitignore
0 → 100644
View file @
b30cacb0
/MobileEventGuide
MobileEventGuide/res/layout/main.xml
View file @
b30cacb0
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"fill_parent"
android:layout_height=
"fill_parent"
android:orientation=
"vertical"
>
<TextView
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/hello"
/>
</LinearLayout>
\ No newline at end of file
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"fill_parent"
android:layout_height=
"fill_parent"
android:background=
"@color/background"
>
<ImageView
android:id=
"@+id/camera3"
android:layout_width=
"fill_parent"
android:layout_height=
"40dip"
android:clickable=
"true"
android:gravity=
"center"
android:src=
"@drawable/camera3"
/>
<ImageView
android:id=
"@+id/pictureholder"
android:layout_width=
"fill_parent"
android:layout_height=
"fill_parent"
android:gravity=
"center"
android:layout_below=
"@+id/camera3"
android:src=
"@drawable/ic_launcher"
/>
</RelativeLayout >
\ No newline at end of file
MobileEventGuide/res/values/strings.xml
View file @
b30cacb0
...
...
@@ -3,5 +3,6 @@
<string
name=
"hello"
>
Hello World, MobileEventGuide!
</string>
<string
name=
"app_name"
>
MobileEventGuide
</string>
<color
name=
"background"
>
#ffffff
</color>
</resources>
\ No newline at end of file
MobileEventGuide/src/mobile/event/org/MobileEventGuide.java
View file @
b30cacb0
package
mobile.event.org
;
import
android.app.Activity
;
import
android.content.Intent
;
import
android.graphics.Bitmap
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.view.View.OnClickListener
;
import
android.widget.ImageView
;
public
class
MobileEventGuide
extends
Activity
{
public
class
MobileEventGuide
extends
Activity
implements
OnClickListener
{
/** Called when the activity is first created. */
int
CAMERA_PIC_REQUEST
=
3333
;
@Override
public
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
main
);
ImageView
CameraButton
=
(
ImageView
)
findViewById
(
R
.
id
.
camera3
);
CameraButton
.
setOnClickListener
(
this
);
}
public
void
Camera
(){
Intent
cameraIntent
=
new
Intent
(
android
.
provider
.
MediaStore
.
ACTION_IMAGE_CAPTURE
);
startActivityForResult
(
cameraIntent
,
CAMERA_PIC_REQUEST
);
}
protected
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
Intent
data
)
{
if
(
requestCode
==
CAMERA_PIC_REQUEST
)
//
if
(
resultCode
==
Activity
.
RESULT_OK
)
{
// Display image received on the view
Bundle
b
=
data
.
getExtras
();
// Kept as a Bundle to check for other things in my actual code
Bitmap
pic
=
(
Bitmap
)
b
.
get
(
"data"
);
if
(
pic
!=
null
)
{
//Display your image in an ImageView in your layout (if you want to test it)
ImageView
pictureHolder
=
(
ImageView
)
this
.
findViewById
(
R
.
id
.
pictureholder
);
pictureHolder
.
setImageBitmap
(
pic
);
pictureHolder
.
invalidate
();
}
}
else
if
(
resultCode
==
Activity
.
RESULT_CANCELED
)
{}
}
@Override
public
void
onClick
(
View
v
)
{
switch
(
v
.
getId
())
{
case
R
.
id
.
camera3
:
Camera
();
break
;
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment