Experience in writing App interfaces for the first time

Source: Internet
Author: User
: This article describes the first time you have written an App interface. For more information about PHP tutorials, see. The lead gave me a task, asking me to work with IOS and Android to generate an app4.0 version for the platform's mobile phone version. Before that, I did not write interfaces, so I was a little blind.

Later, I consulted my predecessors and wrote a little bit slowly. I basically mastered the handover rules within one day. the most difficult part was debugging, because it was also a secondary development, in addition, I was not very familiar with some of the functions, so I was so frustrated that I finally went through and went online. Redis and Memcache are mainly used this time. Although I have read Redis, it will take a while to use it. Here are some examples:

1. it is the data transfer problem of Redis,
$ Redis = new Redis ();
$ Redis-> set ("test". $ user ['id'], $ packet_token );

However

$ Redid = $ redis-> get ("test". $ user ['id']);

But they cannot get the value.

The reason is that redis does not set the Expiration Time. Add $ redis-> set2 ("user". $ user ['id'], $ packet_token, 1000) when assigning values );

2. Redis queue blocking

During app testing, redis blocks various types of errors and logs. for simple blocking, you only need to ask for the queue (execute the script ):

#! /Bin/bash
#
REDIS_PASS = aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Redis-cli-a $ REDIS_PASS lpop fund: queue: sandbox
Redis-cli-a $ REDIS_PASS set fund: queue: locked''
Supervisorctl restart all

For the error log, one of the errors took me half a day:

The reason is that there is a field uniqueness constraint in the table. the value stored in redis should be of the list type, but the string type is passed due to an error. you only need to clear the table data and restart redis.

3. I finally got online, but the redemption amount could not be redeemed.

Because each account has an account lock, the user cannot click it consecutively because multiple redemption attempts are made, but the account lock is applied to a single redemption, therefore, you only need to add the account lock to multiple redemption attempts.

The above introduces the first time I wrote an App interface, including some content. I hope my friends who are interested in the PHP Tutorial can help me.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.