For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 37 replies, 3 voices, and was last updated 11 years, 11 months ago by
Henzalah.
-
AuthorPosts
-
March 30, 2014 at 9:59 am #348401
HenzalahMemberactully it is the same one i dont have any DB for example i want to put a user name and password for each Apartment (apartment1.mobi) will be linked to a user name and password
(apartment2.mobi) will be linked to a user name and passwordso the login UI (ID and password ) will link me to the prefered Apartment
March 30, 2014 at 11:34 am #348402
Code_AMemberAre you planning to hardcode usernames and passwords before you distribute the app??? If that is your plan then you could just link everything together using arrays.
var users=new Array("user1","user2","user3"); var pass=new Array("pass1","pass2","pass3"); var aptNum = $('#m1-cosy-textField1').val(); var username= $('#m1-cosy-textField2').val(); var password= $('#m1-cosy-textField3').val(); if (users[aptNum -1] == username && pass [aptNum -1] == password){ //pass phoneui.gotoScreen('m1-apartment' + aptNum); }else{ //fail }I am not sure I completely understand what you are trying to here with the usernames.
Out of curiosity, is the information that you are going to be displaying on the apartment screens static or dynamic? I am trying to get a feel for your app purpose and functionality.
March 30, 2014 at 11:52 am #348403
HenzalahMemberin the welcome screen i have 2 buttons (staff-guest)
what i want to do is:
when i press on the guest button it will ask me directly for a user name and password or password at least and this will takes me directly to the appartment.mobiwhat do u think maybe u have a better idea which will save alot of effort and time!!!
if it is possible to be directed without a Login UI i dont mind even, i created the login UI but if it will make me suffer i prefer not to use it.
March 30, 2014 at 12:02 pm #348404
Code_AMemberHow are you going to manage the usernames and passwords? Do you want the users change their usernames and passwords, or are you going to want to change the usernames and passwords after you distribute the app? Do you want users to be able to log in using different devices? Typically usernames and passwords are setup on web server that the app connects to so that the info is not specific to a device.
Here is a How-To on a Login Scenario.
March 30, 2014 at 12:23 pm #348405
HenzalahMemberi will provide the guests with the user name and the password
each guest will be using this for a short duration and after he leave i will modify passwords and the user names again so that he cannot log in again when he is not using the apartment.the app user must not change anything (user ID – password) he will only read info i supply.
and it will be installed on one device.and for the login scenario i already read it but to be honest it doesn’t help me that much.
March 30, 2014 at 12:28 pm #348406
Code_AMemberOk, so how are you planning to modify the content that you supply the guests? Are you supplying the devices or will the guests be installing the app on their own devices?
I guess, either way I would recommend storing this information in a database on a server with php interface between the DB and your app. This will make your life a lot easier when you need to update the content.
March 30, 2014 at 12:42 pm #348407
HenzalahMemberas what i understood from ur words that it is kind of impossible to modify the content of the app after publishing is this true ??
i am forced to do it the hard way since they don’t have any database or servers…
and regarding the devices they will be using there own devices.so what do u suggest?
March 30, 2014 at 1:02 pm #348408
Code_AMemberIf you do not have access to a web server then you are pretty much limited to storing everything locally and providing new content through app updates, which is a very inefficient and an extremely undesirable method. Ideally, you need a web service to do what you are trying to do.
March 30, 2014 at 1:14 pm #348409
HenzalahMemberfor now i can do nothing except going ahead of this project since i hate to leave not finished stuff..
regarding this code where i should implement it in which page can u guide me plzz !!!
var users=new Array(“user1″,”user2″,”user3”);
var pass=new Array(“pass1″,”pass2″,”pass3”);var aptNum = $(‘#m1-cosy-textField1’).val();
var username= $(‘#m1-cosy-textField2’).val();
var password= $(‘#m1-cosy-textField3’).val();if (users[aptNum -1] == username && pass [aptNum -1] == password){
//pass
phoneui.gotoScreen(‘m1-Apartment’ + aptNum);
}else{
//fail
}and regarding updating the data later one i have to do it manual at least till they have servers and DB
March 30, 2014 at 1:33 pm #348410
Code_AMemberYou would place the code behind the button that the user clicks to login and go to the screen. Basically, you wold take the current gotoScreen code you have behind the OnChange event of textField1, put 2 more textfields on the screen (username and password) and a button, then when the user clicks the button it checks the three fields and does its thing.
March 30, 2014 at 1:49 pm #348411
HenzalahMemberso i should create 3 textfield
the 1st one is for apartment
the 2nd one is user name
the 3rd one is for password
and a button (log-in)this is what i understood and the code is under the log-in button.
but for the three textfields no codes required
can u please clear this for me
March 30, 2014 at 2:25 pm #348413
Code_AMemberThat is correct. However, you will want to use a password field instead of a textfield for the password.
March 30, 2014 at 2:57 pm #348415
HenzalahMemberit didnt work and shall i add additional project files (apartment1.mobi,……)
Attachments:
You must be logged in to view attached files.March 30, 2014 at 4:32 pm #348416
Code_AMemberAre you typing in User1 and Pass1 in the fields and an apt number? Yes, you need to add the apartment files to the project. Can you post your files?
March 30, 2014 at 4:39 pm #348417
HenzalahMemberyes i am and which files do u need exactly ??
-
AuthorPosts
