last day (16 days later) » 
16:00 - 19:0019:00 - 22:00

7:00 PM
Ya...
 
package com.ebookfrenzy.inappbilling;

import <your domain>.inappbilling.util.IabHelper;
import <your domain>.inappbilling.inappbilling.util.IabResult;
import <your domain>.inappbilling.inappbilling.util.Inventory;
import <your domain>.inappbilling.inappbilling.util.Purchase;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Button;
import android.view.View;
import android.content.Intent;
import android.util.Log;
this is how you set up in app billing in the project
 
check the above its an example of implementing in app billing and on clicking a button u will buy a product
 
An activity?
 
yes
this is not the full activity check the tutorial
it has a button in the activity that u click to buy
 
7:09 PM
ok
the thing that I can not do is this :
Using the explorer or finder tool for your operating system, navigate to the <sdk path>/sdk/extras/google/play_billing where <sdk path> is replaced by the path into
because google services billing library
it's been replaced with : implementation 'com.android.billingclient:billing:1.0'
 
yes in the new version use implementation
correct..
 
So I can not add the aidl
stuff
 
are u adding in google play console first?
 
adding what?
 
products..
where is your inappbillingservice.aidl?
file
look at the image above
 
7:18 PM
Ya I know bro...
 
yes...
 
but I can get the file if I install the google service billing
but that's deprecated...
 
yes its like the picture
 
Bro I do not have that file...
 
alright
 
7:22 PM
 
do u have this directory /src/main/aidl/com/android/vending/billing/?
 
does this not work compile 'com.android.billingclient:billing:1.0'
?
and this in manifest <uses-permission android:name="com.android.vending.BILLING" />
 
okay
may I get the bounty?
 
7:37 PM
I'd like to implement it first..
because look what a guy told to me
You cannot store images in your Firebase database. You need to store them in Firebase Storage. In Firebase database you need to store only the urls of those images.
The flow is like this: upload image to Firebase Storage -> get the url of the corresponding image (when uploading) -> store the url in Firebase Database -> use the reference to display the image
 
yes I told u that
store image in firebase storage then take url to database
 
yes...
 
FirebaseStorage mStorage;
mStorage= FirebaseStorage.getInstance().getReference();
u have to do this
u have to do this
get the image example : img.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i=new Intent(Intent.ACTION_GET_CONTENT);
i.setType("image/*");
startActivityForResult(i,request_code);
}
then to put image on screen u can do this @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if(requestCode==request_code&&resultCode==RESULT_OK){
uri=data.getData();
img.setImageURI(uri);


}

}
add this one to add url in database: StorageReference filepath=mStorage.child(uri.getLastPathSegment());
filepath.putFile(uri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
String downloaduri=taskSnapshot.getDownloadUrl().toString();
refProd.child("image").setValue(downloaduri);
 
7:52 PM
I have to go by parts...
I have to do 2 things, and I do not know from where start...
Since now, I have firebase created with db (only the user)
Now, I have to create the products...
I have to create them on the same Login Activity?
 
no u can create them in another actiivty
 
doesn't matter but I have to create all of the products?
 
yes
and send them to database
 
But Ihave to create all of the skeleton, right?
 
u mean the db? then yes
 
8:01 PM
So I have to create all empty, right?
I have this at the moment
Firebase-root
|
--- users
| |
| --- uid1
| |
| --- //user details (name, age, address, email and so on)
| |
now I have to create a Products inside the uid1, right?
 
no
u have to create child("products") as a node in itself
inside of it there is name and price
then when a user buys a product his id will be inside the productid
and the productid will be inside his uid1
and both uid1 and productid1 will be equal to true
also I saw ur update in the question, I have sent you the code regarding the image above with firebase storage and database above
 
Yes, i'm lot of confused...
Still can't handle all of what I want :S
 
DatabaseReference refprod=FirebaseDatabase.getInstance().getReference().child("products").push();
refProd.child("name").setValue(prodname);
refProd.child("price").setValue(price);
now above u added the products to database
 
see this pls
I'll explain you my goal and try to let me know what should I go first for :
First User will login to my app
User will see a list of products (Available,Purchaseds,NotPurchaseds) with an image
User can buy products that he doesn't own
-----------------------------------------
I have Login with Gmail (Firebase)
I've starting to create the db with Firebase following your schema and I'm stuck here
Firebase-root
|
--- users
| |
| --- uid1
| |
| --- //user details (name, age, address, email and so on)
 
could have used my db
but okay login is done and users db is done now do products
DatabaseReference refprod=FirebaseDatabase.getInstance().getReference().child("products").push();
refProd.child("name").setValue(prodname);
refProd.child("price").setValue(price);
the above will add products in the db
 
8:17 PM
Here I have to add ALL products?
I mean, the free ones, the payables ones
etc?
 
no u add all the products with price in the one I gave u
 
I mean... I have to do something like this :
 
--- products
| |
| --- productId1
| | |
| | --- productName: "Apples"
| | |
| | --- price: 11
this is the above that I gave u
 
DatabaseReference refprod=FirebaseDatabase.getInstance().getReference().child("cards").push();
refprod.child("name").setValue(prodname);
refprod.child("price").setValue(price);
refprod.child("name").setValue(prodname);
refprod.child("price").setValue(price);
refprod.child("name").setValue(prodname);
refprod.child("price").setValue(price);
refprod.child("name").setValue(prodname);
refprod.child("price").setValue(price);
 
who gave u that code?
 
8:18 PM
I just copied and pasted
what you gave to me
but more than 1 product
or first try with 1 product?
 
no u dont write it multiple times
just like this
DatabaseReference refprod=FirebaseDatabase.getInstance().getReference().child("products").push();
refProd.child("name").setValue(prodname);
refProd.child("price").setValue(price);
 
and u can create as much products as u want
 
refprod.child("name").setValue("prod1");
refprod.child("price").setValue(0.99);
like this?
 
8:20 PM
ok, now?
 
did u do it?
 
now u have to make a button where the user buys a product
when he buys the product he will have this under his uid
products
| |
| --- productId1 : true
| |
| --- productId2 : true
|
and this will be added under productid: users
| |
| --- uid1: true
 
Yes
but only if the card and the payment is successfull, right?
 
what card?
Firebase-root
|
--- users
| |
| --- uid1
| |
| --- //user details (name, age, address, email and so on)
| |
| --- products
| |
| --- productId1 : true
| |
| --- productId2 : true
|
--- products
| |
| --- productId1
| | |
| | --- productName: "Apples"
| | |
| | --- price: 11
| |
| |
| --- users
| |
| --- uid1: true
 
8:23 PM
i meant if the payment is ok
 
if user using this db, it says purchasedproducts so when u buy the product, purchasedproducts will be added to db
yes true
again the db is like this (u did products and user) user buys a product then productid:true is added under his uid, also his uid:true is added under the products/productid
so here he bought the product (the above)
 
I got that
yes
 
then after that purchasedproducts will be created and uid1 will be added there, with the list of all productids that he bought and they will have value true, so productid:true
 
sure
from there I'm ok
my doubt is ...
how do I full this list?
 
what?
 
8:27 PM
I had this
mCards = new ArrayList<CardPOJO>();
mCards.add(new CardPOJO("1", Image));
mCards.add(new CardPOJO("2", Image));
rv = (RecyclerView) findViewById(R.id.recycler_view_chooseCard);
mAdapter = new CardAdapter(this, mCards);
rv.setAdapter(mAdapter);
how do I fill up mCards?
 
u have to create a model class in that case
refProd.child("product").setValue(mCards)l
refProd.child("product").setValue(mCards);
 
what's that?
 
refProd.child("product").setValue(mCards); to add the values to db
 
nono
I mean... I want to fill the mCards
with the products from my DB
 
oh u want to retrieve from db to arraylist
references=FirebaseDatabase.getInstance().getReference().child("product");
addclass.addChildEventListener(new ChildEventListener() {
@Override
public void onChildAdded(DataSnapshot dataSnapshot, String s) {

String inputs= dataSnapshot.child("prodname").getValue().toString();
mCards.add(inputs);

adapter= new ArrayAdapter<>(TeacherNavActivity.this, android.R.layout.simple_list_item_1, alist);

list.setAdapter(adapter);


}



@Override
public void onChildChanged(DataSnapshot dataSnapshot, String s) {
here u retrieve and add inside mCards the arraylist
 
8:45 PM
yes
 
okay
 
pfff
Now that guy is telling me to use
Google cloud firestore
 
just stick to firebase
 
yes just use firebase
 
8:58 PM
it's all new for me
and I see it super big
:c
 
yes its fine, not a problem just needs time
 
You can help me to produce it?
 
it needs time to be finished, like weeks so u can understand the docs and stuff
I explained most of the stuff here how to do them
all u need is to read the docs more so u will be able to implement the stuff that are left
 
I see..
 
9:20 PM
yes no one is gonna help as much as I helped you that's for sure, pretty much you are asking for someone to do the app..
but anw, just read the docs look at the code that i gave you here(auth+database+image) and u will be able to do it
 
9:34 PM
I'll put you the bounty
but if I face with problems while I'm developing
could you help?
 
yes sure
but u need to read the docs.. and see youtube videos
to understand more
 
yep I know
 
also no need to complicate it at first in my opinion just do like a test one if it worked then make it more complicated
and publish it
 
you know...
from start I wanted to make 2 apps
1 with all free and other with more products...
but I thought it won't be so complicated...
but wow...
I got stomped
 
yes its not easy
 
9:37 PM
what do you recommend to me?
Start doing a separate app?
or keep going?
do you think I've almost done ?
or it needs more work?
 
I guess first do a layout with what you want in each activity
maybe on a paper.. to know what to write
then starting creating the database yes maybe in a seperate app if u want
u have the database.. I explained the database for u
and u did the authentication
so basically u have the other nodes in the database left I think?
and the billing stuff
 
yes
I need the billing stuff
and the populate products
 
populate products means retrieve from database
u can use the one I sent
or use FirebaseRecyclerAdapter
there is FirebaseRecyclerAdapter which u can use instead of RecyclerView
 
but I had a custom adapter
I'll loose it, right?
 
yes just use firebaserecycleradapter
to make it easier for u
 
16:00 - 19:0019:00 - 22:00

  last day (16 days later) »