- 724 Posts
- 3 Reply Likes
Posted 4 years ago
- 724 Posts
- 3 Reply Likes
JesseMonroy650 (Volunteer), Champion
- 3325 Posts
- 122 Reply Likes
very good beginning. I would recommend you fix the header image.
Best of Luck
Jesse
- 724 Posts
- 3 Reply Likes
- 724 Posts
- 3 Reply Likes
JesseMonroy650 (Volunteer), Champion
- 3325 Posts
- 122 Reply Likes
- 724 Posts
- 3 Reply Likes
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
JesseMonroy650 (Volunteer), Champion
- 3325 Posts
- 122 Reply Likes
- 724 Posts
- 3 Reply Likes
It's not showing anywhere,, yes one plugin i found with same name..but its showing how to install, it's not showing to add in config.xml
Secondly i checked on github, there was a sample app, but its using plugin.xml not config and there is not also index.html file :(

- 724 Posts
- 3 Reply Likes
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
<plugin name="cordova-plugin-geolocation"/>- 724 Posts
- 3 Reply Likes
<gap:plugin name="cordova-plugin-geolocation" source="npm" version="4.3.81" /> is that correct? or i can leav version attribute?Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
You don't need the source
You don't need the version.
All you need is the code line as I posted 18 minutes ago.
- 724 Posts
- 3 Reply Likes
- 724 Posts
- 3 Reply Likes
How i can create an app, which can use user's current location and send it to server?
The Server side i can Handle as @Petra Sir said before, but can u tell me that how i can fetch current geo location ?
- 724 Posts
- 3 Reply Likes
is it possible or any other way to store location in a database.? Thank You
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
But you don't want that. In a database, you store the plain data. The presentation layer of your application should take care of how the end user gets to see them.
And secondly: what database? Remote or local?
- 724 Posts
- 3 Reply Likes
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
So, you would get the location (x,y), and send it to the server using ajax. The remote application will also probably need other attributes like user-id, device-is or track-id to be able to store the coords.
- 724 Posts
- 3 Reply Likes
- 724 Posts
- 3 Reply Likes
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
But what you are planning to do is not a good idea.
Suppose you are storing that URL. Your application shows that URL (and apparently also a name and a Location, which must also be in the database, nicely normalized).
Now, your boss says: "I want a report of all complaints within a given radius around the Headquarters". What are you going to do? Give him a list of URLs and tell him to see how he gets his information, because you have nothing but URLs in your database? No. You need the barebone coordinates in order to calculate distances. So, with the URLs only, you're stuck.
A decent developer would only store data in his database, not a presentation form. The URL (or the table with distances) are generated from those bare data within the presentation layer!
Now, let's start with your back end. What does your ER model look like? You will most likely have Person and Complaint entities with a relationship in between. Can one Person file multiple complaints? Can one Complaint be filed by multiple Persons? Can one Location have multiple Complaints?
So, please describe your ER model and the keys and attributes for each entity.
(You are an IT student, aren't you?)
- 724 Posts
- 3 Reply Likes
After BCA i was able to develop only CUI based applications. In the starting Semester of MCA i start GUI applications with databases and RDBMS what u said some minutes ago.
From two years i was learning web designing, i properly knows how to make static websites, and after that i learned how to make dynamic websites using php. I am good also in php+mysql i have made lots of dynamic websites with localhost, and remote/ also.
Now i was new phonegap build.
With the help of U and Sir Jesse, i have learned many things.
and Yes i have to work with ER diagrams and yes i have to plans nicely first.
I agreed that this is my mistake i have jumped in a river without having swimming skills. Let me describe my ER and entity relation ship first, thanks alot with ur valuable guidlines. :)
- 724 Posts
- 3 Reply Likes
I can't fully blaim to my teachers for that, coz i know that our best teacher is we are.
Self Study is the best study, therefore i tried to learn myself.
By d way i am sharing our personal problem sorry phonegap build community.
JesseMonroy650 (Volunteer), Champion
- 3325 Posts
- 122 Reply Likes
we already know or have suspected what you are saying.
Best of Luck,
Jesse
- 724 Posts
- 3 Reply Likes
- 724 Posts
- 3 Reply Likes
I have a Question, i know that i have already asked this question before, but want to know that Can I easily use PHP with PhoneGap Build?
Because I can create full Hybrid App using PHP 7 and MySQL 5.7
But little disturbed to use plugins with Phonegap build.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
Sir, Chris Griffin but we can use php locally with the help of LOCAL WEB SEVERS Like WAMP, MAMP, XAMP etc?
To answer this:
I believe that your image of 'locally' and 'use PHP with Phonegap Build' is a bit....ehrrm...unordered.
You should try and see it this way:
An application consists of:
(1) centrally managed data
(2) business processes, which use the data and are maintained at one single place
(3) client interaction and presentation, available to each user.
Now, this means that the application owner manages his data and processes in a central place, usually a server. Also, there are client programs which are distributed among users/visitors; these display the information from the central database/process and allow interaction. Such clients can be apps, web pages, television sets, sports wrist watches or any other device.
In the CENTRAL PLACE, you have:
- the database. Contains structured data.
Communication usually with SQL. 'Database' may also be a set of flat files, a data warehouse, a hierarchical database (IMS DB) or other implementation of structured data.
- the process logic. Performs calculations, checks constraints, prepares SQL requests. Usually, these processes are written in a server side language, e.g. PHP, Perl, Cobol, .Net, ....
Included are 'web services': server-side scripts that communicate with the clients out there. Web services receive requests for information from the client. They (the web services) are server side scripts that prepare fetching data from the database, then process the data according to business rules and return them in a standard form, e.g. XML or JSON.
The web service doesn't care who or what it is that asks for information. It can be a website, a coffeemachine or an app. It can be all kinds of different apps. All the web service knows is: 'if I receive a request of Type-X, I must return a JSON object of Type-Y".
On the USER SIDE, you have:
- a client application. This displays information and allows for interaction with the user.
In case of Phonegap, this would be a hybrid app, downloaded and installed on many devices. At the same time, there might be other clients, like web pages or other devices. All clients communicate with the same web services.
Those apps don't know wat the web services do, and how they obtain their data. The client doesn't know whether there is one or multiple databases at the server, or whether the data are obtained from other sources by the web service. The clients only know how to ask questions and what kind of object is returned.
The Phonegap apps are usually written in HTML/Javascript/CSS (or such frameworks) and NOT in a server side language like PHP.
In Javascript, the clients can use the XHR, a request object used for Ajax, the communication technique to make http requests to a web service.
====== SERVER? CLIENT? =======
Usually a server is a machine in a central place, for instance at a company's data center or at a web hoster's facility. It's the place where database and business processes are performed and maintained.
Languages: SQL and PHP (or similar)
Usually, the client is one of many display devices, such as a person holding an app on his phone or a web page in his home PC browser. Or for instance a waiter, in front of the ice cream shop, passing the order to the main desk using a device.
Languages: HTML5 (in case of hybrid apps), Java
NOTE: The server can be at any central place. The clients can be at any place. You can have a PC with a XAMPP server (containing the database and the web service scripts) and an emulator showing your app. n such case, you STILL have server processes and client processes....you just happen to have them on the same machine.
Once you have 1,000,000 users of your application, you will see that there is still only one server....and 1,000,000 clients, downloaded on the phones. And THEN you will understand why you don't want to perform server processes on each and every single client device.
- 724 Posts
- 3 Reply Likes
- 724 Posts
- 3 Reply Likes
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
So, I am going to describe what I understand. Please correct my assumptions and answer my questions:
The user starts the app. No need to log in.
He opens the COMPLAINT page and enters his name, his address, his phone number and mail address, picks a Complaint Type and writes his complaint in text. He may capture an image and may choose a location. The data are submitted to the server.
1. a. How many complaints can one user submit in the lifetime of the app? Do you want information/reports about all complaints of one user?
b. How many users can - together or separated from each other - report the same complaint? Do you want information about the users who filed one single complaint?
2. a. If a user can send more than one complaint, do you want him to enter his name, address and phone/email each and every time again, or should he be able to register an account?
b. Suppose you want such accounts...what if a user changes his name (because [s]he is getting married), do you want to also keep the old name under which the previous complaints were sent? What if a user moves his household to another town?
c. Why do you need the user's residence address? What if he has none and lives under a bridge?
3. How do you produce the picklist of Complaint Types? What if you want additional types and what if you want to disable one type? Is this a fixed list that is managed centrally at the back office?
4. How many images may the user send with his complaint? Zero? One? More than one?
5. How many locations may the user send with his complaint, for instance if he wants to report three different defective street lights?
6. Do you want to send all users (or a selection of users) mails, like reminders, follow-ups, thank-you messages, newsletters?
7. Why do you mention "Current_location" in your model? Is it required that the user is actually at that particular location when posting his complaint?
If there's a fire, should he be inside the flames to send his data, or may he run away, first?
- 724 Posts
- 3 Reply Likes
Actually it's a small city named 'Amroha'. The Cleaning Department gave me this task to receive people's complaints and store them in a database. We will update our database time to time, and will try to sort out their problems. With their complaint's location and a proof of place as image, where is garbage is stored.
Here are some points i planned before creating this app.
1. As u know that i didn't made user registration process. So can't keep a track of users. That how many complains a user can book. We will just record their complaints with unique Complaint_ID. and i want to know some queries, like how many people booked same complain, i will use SQL query language to find out results with different condition, and can prepare reports with queries set.
2. It's my compulsion that i have to do like this, means i will keep records again and again. Because i don't know how to make sessions in php. Only i can create user-registration process with same login page. I am getting your point i will learn sessions too. For profile updation, It must be create user registration, so that i can see how many users we have. And also can relief from database overload.
3.Yes, at one time user can only book one complain therefore i used dropdown list.
4. At one time user can upload only one image.
5.Yes, It must chose multiple locations for multiple problems.
6.Yes I want to send messages like "Thanks to Booked a complain, we are solving your problem! Your Complain No. is XXXXX" and after problem sort out want to show message "Your Complain XXXX is solved now " and also i want status is my database of every complain which is sort out ot not, as it's status SOLVED or IN PROCESS.I want to send msg to selected users.
7. It's also a big mistake. It should be use Only Chose location Button name, But the problem is that Its a small town. On google all areas are not uploaded yet, then how users can find them on google map? Or I should remove this option? Only address we can continue ? with street no. and house no.? We can use validation on street and house no. near about the problem space?People can't leave them empty,
Sir i am using your lots of time, for me you type too many lines, i can't pay thanks to u, coz its a small word.
Sir I need your help more.
Help me, i have to complete it soon.
JesseMonroy650 (Volunteer), Champion
- 3325 Posts
- 122 Reply Likes
you should know that Petra is very generous with time. However, we are not a consulting organization. I will suggest that you find others near or around you that can help with with decisions and design.
Best of Luck
Jesse
- 724 Posts
- 3 Reply Likes
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
1. My initial ER model would be:
|COMPLAINT|-n---|---1-|COMPLTYPE|
COMPLAINT:
- id (int, autoincrement, PK)
- personname (txt, not null)
- personmail (txt, unique)
- personphone (txt, unique?)
- locationtext (txt)
- locationLAT
- locationLONG
- image (blob)
- compltype:id (int, FK)
COMPLTYPE
- id (int, autoincrement, PK)
- activeyn (enum:Y,N)
- description (txt)
You need a separate table for Complaint_Type, because you have a 1:n relationship and you want to manage the Complaint_Type table externally, not in the app. The app will display all active COMPLTYPE:description from the table into the pick list. This way, you won't have to update your app if the client wants new descriptions, types, etc.
I would not store the person's residence address. Not needed, I think
I would make email and phone number not mandatory. If people don't want to give their mail address or phone number, they simply won't get confirmation mails or thank-you's. The phone number is only necessary for further questions, if the complaint is unclear.
The user should have the option of
- posting the current lat/lon (save them separately, so you can have distance calculations without further parsing)
- picking a spot from a Google map. Lat/Lon are stored
- describing the location (address, or something like "at the southern end of Lake Local"). Lat/Lon are null, locationtext is stored
The image is stored as a base64 blob.
From this solution, you could later:
- take the person data out, and create a PERSON table with n:m relationship to COMPLAINT, so you can have multiple person per complaint and vice versa
- take the image blobs out, move them to a new COMPLAINTIMAGE table, with n:1 relationship to COMPLAINT, so you can have multiple images for each complaint.
- 724 Posts
- 3 Reply Likes
Respected Sir,
As near I understand your solution, you want I receive COMPLAINTS table, and the status I keep in COMPLTYPE table, and update manually? by enum data Y or N?
This point I couldn’t understood.
The app will display all active COMPLTYPE:description from the table into the pick list. This way, you won't have to update your app if the client wants new descriptions, types, etc.
This is okay if we are not keeping person’s addresses, as u said not needed.
-you want that I do not keep record of email or phone no as mandatory, It’s user’s choice, s[he] fill his/her phone number. But People can use it wrong, they can book lots of fake complaints, and we can’t even contact them. In small cities people have much time to do stupid activities like this. And if we will ask for their registered phone number or email, how we can verify it?
-I couldn’t also understood use of locationtxt field. Which type of data we will record in this field?
As I understand I just roughly draw these tables, are they ok?
This following point I also couldn’t understood... Sorry , yes we can store lat and land coordinates e.g. we can do calculation.
picking a spot from a Google map. Lat/Lon are stored
- describing the location (address, or something like "at the southern end of Lake Local"). Lat/Lon are null, locationtext is stored
and in whole solution I couldn’t found that how we can know that user booked complain regarding?
Thanks in Advance Sir.

- 724 Posts
- 3 Reply Likes
I think I should make this App like an Online Shopping App so that we can easily summarize user’s data.
-I will create user registration first, with their registered phone number.
Once user registers in our App, He or She can create their profile there, even they update or delete.
-They will not fill complete form again and again to book complain, after successful login they will see Complaint type page to choose particular problem, directly click on BOOK COMPLAIN button.
-By this also we can keep records easily.
-When they will login in App, only they will choose COMPLAIN TYPE and with image if required and COMPLAINT’s address, and multiple location. If they found same problem at many places.
-When I will update my Database I will see some records with Only registered Phone No. or email that must be unique, and their complain, we will take quick action and we will quick send our employees to different areas to sort out their problem.
-After sort outing problems, we will update our database manually, and a text message [“Your Problem has been sort out with their Complaint No. e.g. Complaint_ID] to complainant’s phone number.
-The Lat and Lang Coordinates also we will keep in database for calculate distance and else, what if user couldn’t find his location on google map? as I said the all Addresses are still not added on google map of Amroha City.
-Because It’s a small City , it’s divided into small small areas called ward. All wards have unique No. If user will book complaint with wardno we can easily keep records. But can’t calculate distance between wards.
-Also by wardno we can easily assign the task to our employees. All wards have limited geographical area.
Sir I can surely create this app with the Help and guidance of You.
Need for your Suggestions
- 724 Posts
- 3 Reply Likes
Because When i searched on google with name Petra V. it was all the girls on google. May b i m wrong to say u Sir? Little doubt sir Sorry
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
May b i m wrong to say u Sir? Little doubt sirYou can call me Sir, Ma'am, Petra or "Hey, you". It doesn't really matter, because in reality, I am an automatied Internet Bot, anyway.
As near I understand your solution, you want I receive COMPLAINTS table, and the status I keep in COMPLTYPE table, and update manually? by enum data Y or N?No, no!
This point I couldn’t understood.
The app will display all active COMPLTYPE:description from the table into the pick list. This way, you won't have to update your app if the client wants new descriptions, types, etc.
This is about the select box ('pick list') for Complaint Types. You want the user to select one of the types, for instance:
- uncollected rubbish on street
- street light not functioning
- rats running around
- ...etc
Now, where do you get these descriptions from, and how are you going to pass them to your web service? You don't plan to hard-code these descriptions and their ID's in the html directly, do you? Because if you do, you would have to build, test, and publish a new app version every time you need to change something in this select list.
Instead, you want the ID's and description to come from a database, which you manage in your back end. That would be the mySql COMPLTYPE table, which contains Type ID's and Descriptions. Complaints would be related to these types using the FK.
Now, what if you want one Complaint Type to not appear in the list anymore? You can't simply delete that tuple from the table in the backend, because you would break existing relationships. So, what you should do is use the activeYN field to switch a Complaint Type off. That way, it would remain in the table and the relationships to existing Complaints would still be there, but that tuple would not be selected anymore when building up the select list in the UI.
you want that I do not keep record of email or phone no as mandatory, It’s user’s choice, s[he] fill his/her phone number. But People can use it wrong, they can book lots of fake complaints, and we can’t even contact them. In small cities people have much time to do stupid activities like this. And if we will ask for their registered phone number or email, how we can verify it?I understand your point.
It's a trade-off, though. As soon as people are forced to create an account and supply their personal data, they might as well rather refrain from using the app. And if nobody wants to use the app, you won't receive the feedback you are persuing to get. So, it should be as easy as possible for users to use your app. They should somehow benefit if they do supply personal data, for instance by supplying them confirmations, status info etc.
- 724 Posts
- 3 Reply Likes
e.g. users can post multiple complaints at same time?
Related Categories
-
PhoneGap Build
- 15111 Conversations
- 275 Followers
-
Plugins
- 1283 Conversations
- 38 Followers








