Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
InstiLostAndFound
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
MUTTINENI NAVYA
InstiLostAndFound
Commits
39404150
Commit
39404150
authored
Oct 29, 2019
by
ankitasingh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added object creation code for found objects before pushing to db
parent
0d1f8020
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
201 additions
and
2 deletions
+201
-2
app/src/main/java/com/example/instilostandfound/CreateFoundObject.java
...java/com/example/instilostandfound/CreateFoundObject.java
+106
-0
app/src/main/java/com/example/instilostandfound/FoundItem.java
...rc/main/java/com/example/instilostandfound/FoundItem.java
+3
-2
app/src/main/java/com/example/instilostandfound/createDemo.java
...c/main/java/com/example/instilostandfound/createDemo.java
+92
-0
No files found.
app/src/main/java/com/example/instilostandfound/CreateFoundObject.java
0 → 100644
View file @
39404150
package
com.example.instilostandfound
;
import
com.google.firebase.auth.FirebaseAuth
;
import
com.google.firebase.database.Exclude
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
public
class
CreateFoundObject
{
//private String mLDAPID;
private
String
mImageUrl
;
private
String
mKey
;
private
String
mTitle
;
private
String
mDate
;
private
String
mLDAP
;
private
String
mDescription
;
private
String
mLocation
;
private
String
mCategory
;
private
Date
mDateFound
;
public
CreateFoundObject
()
{
}
public
CreateFoundObject
(
String
LDAPID
,
String
title
,
String
imageUrl
,
String
location
,
String
desc
,
String
category
,
Date
datefound
)
{
if
(
LDAPID
.
trim
().
equals
(
""
))
{
mLDAP
=
"No Name"
;
}
//mLDAPID = LDAPID;
mImageUrl
=
imageUrl
;
mLDAP
=
FirebaseAuth
.
getInstance
().
getCurrentUser
().
getEmail
();
mDescription
=
desc
;
mLocation
=
location
;
mDateFound
=
datefound
;
mCategory
=
category
;
mTitle
=
title
;
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"dd-MMM-yyyy"
);
Date
date
=
new
Date
();
mDate
=
df
.
format
(
date
);
}
public
String
getLDAP
()
{
return
mLDAP
;
}
public
void
setLDAP
(
String
LDAP
)
{
mLDAP
=
LDAP
;
}
public
String
getmTitle
()
{
return
mTitle
;
}
public
void
setmTitle
(
String
mTitle
)
{
this
.
mTitle
=
mTitle
;
}
public
String
getImageUrl
()
{
return
mImageUrl
;
}
public
void
setImageUrl
(
String
imageUrl
)
{
mImageUrl
=
imageUrl
;
}
public
String
getmCategory
()
{
return
mCategory
;
}
public
void
setmCategory
(
String
category
)
{
mCategory
=
category
;
}
public
Date
getmDateFound
()
{
return
mDateFound
;
}
public
void
setmDateFound
(
Date
dateFound
)
{
mDateFound
=
dateFound
;
}
public
String
getmDescription
()
{
return
mDescription
;
}
public
void
setmDescription
(
String
desc
)
{
mDescription
=
desc
;
}
public
String
getmLocation
()
{
return
mLocation
;}
public
void
setmLocation
(
String
location
)
{
mLocation
=
location
;}
@Exclude
public
String
getKey
()
{
return
mKey
;
}
@Exclude
public
void
setKey
(
String
key
)
{
mKey
=
key
;
}
public
String
getDate
()
{
return
mDate
;
}
public
void
setDate
(
String
date
)
{
mDate
=
date
;
}
}
app/src/main/java/com/example/instilostandfound/FoundItem.java
View file @
39404150
...
@@ -19,9 +19,10 @@ import androidx.appcompat.widget.Toolbar;
...
@@ -19,9 +19,10 @@ import androidx.appcompat.widget.Toolbar;
import
android.view.View
;
import
android.view.View
;
public
class
FoundItem
extends
AppCompatActivity
{
public
class
FoundItem
extends
AppCompatActivity
{
private
DatabaseReference
mDatabase
;
// ...
// ...
//mDatabase = FirebaseDatabase.getInstance().getReference();
FirebaseDatabase
database
=
FirebaseDatabase
.
getInstance
();
DatabaseReference
myRef
=
database
.
getReference
(
"FoundData"
);
@Override
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
...
...
app/src/main/java/com/example/instilostandfound/createDemo.java
0 → 100644
View file @
39404150
package
com.example.instilostandfound
;
import
com.google.firebase.auth.FirebaseAuth
;
import
com.google.firebase.database.Exclude
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
public
class
createDemo
{
//private String mImageUrl;
private
String
mKey
;
private
String
mTitle
;
private
String
mDate
;
private
String
mLDAP
;
private
String
mDescription
;
private
String
mLocation
;
// private String mCategory;
private
Date
mDateFound
;
public
createDemo
()
{
}
public
createDemo
(
String
LDAPID
,
String
title
,
String
desc
,
String
location
,
Date
datefound
)
{
if
(
LDAPID
.
trim
().
equals
(
""
))
{
mLDAP
=
"No Name"
;
}
//mLDAPID = LDAPID;
//mImageUrl = imageUrl;
mLDAP
=
LDAPID
;
mDescription
=
desc
;
mLocation
=
location
;
mDateFound
=
datefound
;
//mCategory = category;
mTitle
=
title
;
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"dd-MMM-yyyy"
);
Date
date
=
new
Date
();
mDate
=
df
.
format
(
date
);
}
public
String
getLDAP
()
{
return
mLDAP
;
}
public
void
setLDAP
(
String
LDAP
)
{
mLDAP
=
LDAP
;
}
public
String
getmTitle
()
{
return
mTitle
;
}
public
void
setmTitle
(
String
mTitle
)
{
this
.
mTitle
=
mTitle
;
}
public
Date
getmDateFound
()
{
return
mDateFound
;
}
public
void
setmDateFound
(
Date
dateFound
)
{
mDateFound
=
dateFound
;
}
public
String
getmDescription
()
{
return
mDescription
;
}
public
void
setmDescription
(
String
desc
)
{
mDescription
=
desc
;
}
public
String
getmLocation
()
{
return
mLocation
;}
public
void
setmLocation
(
String
location
)
{
mLocation
=
location
;}
@Exclude
public
String
getKey
()
{
return
mKey
;
}
@Exclude
public
void
setKey
(
String
key
)
{
mKey
=
key
;
}
public
String
getDate
()
{
return
mDate
;
}
public
void
setDate
(
String
date
)
{
mDate
=
date
;
}
}
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