Codes to improve firebase chatting app in sketchware

Here are a few codes which can be used in the chat application created using Firebase in Sketchware.

1. Remove divider​ height of ListView
To remove the divider height of ListView displaying messages, put following code in onCreate, in an add source directly block.

2. Display end of ListView on refresh
To make the ListView scroll to display the last element of list when updated, put following code in onCreate, in an add source directly block.

3. Set width of ListView items to 3/4 of screen width
Firstly, in CustomView, insert a LinearH linear1, and inside that insert a LinearV linear2. Put all contents to be displayed in linear2.

Now, in event onBindCustomView, add a number variable width. Set width to getDisplayWidthPixels * 0.75, and set it as width of linear2 using following code.
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams((int)width, LinearLayout.LayoutParams.WRAP_CONTENT);

4. Rounded corners and Custom background color
In onBindCustomView event, add a add source directly block and put code to create a GradientDrawable with custom background color and rounded corners, as given below, and set it as background of linear2. gd = new;

5. Display messages of device user on right and those of others on left.
To display messages of user on right and those of others on left, in onBindCustomView event, use blocks as shown in image above. The code used is:
If File user getData key username equals (get value at position key name of List Map map1) then,

6. Hide Keyboard on button click
Add following code in on button click event.
android.view.inputmethod.InputMethodManager imm = (android.view.inputmethod.InputMethodManager)getSystemService(INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);

To understand more watch the video below.


  1. How to load image from url in listview

  2. Great job. Is it possible make push notifications?

  3. This comment has been removed by the author.

  4. Hi Sanjeev,
    How can we get the current location of the device (GPS)?

  5. A questão da ListView quando atualiza a lista ela rola automaticamente para baixo, tem como fazer ela atualizar mais manter a tela na mesma posição? Desde já agradeço

  6. Is it necessary to upload the app to play store? Isn't it possible that two people download it from sketchware only?

    1. You can send the apk file to your friend, no need to upload to play store

  7. How to add chat rooms in chatting App?

  8. How to make notification of this chat app?

  9. This comment has been removed by the author.

  10. Guys what will be happening if my app doesn't open if I send it to another user with android 8.0 mobile phone and the app doesn't open . .it says app not installed

    1. Tell your friend to free up some space and try again

    2. Maybe you don't have enough storage space

  11. Visit my blog perfect Login With Email Verification

  12. Can you make a chat app where you chat with friends? If you have their numbers like WhatsApp.

  13. is it possible to send sms directly through created app because it opens regular messaging app and i have to type and send the sms

  14. Maybe you don't have enough storage space

  15. Someone should send me a PDF on how to create a chat app using sketchware . Thanks

  16. Very interesting. Your article is so convincing that I can never stop myself from saying anything about it. You are doing a great job, thanks for sharing such a great blog.
    free tamil chatting site

  17. I admire this article for the well-researched content and excellent wording. I got so involved in this material that I couldn’t stop reading. I am impressed with your work and skill. Thank you so much.Spam Free Chat Rooms for Online Chat USA

  18. Very good knowledge, You have provided excellent information for us. It is valuable and informative for everyone. Keep posting always. I am very thankful to you. Thanks once again for sharing it. Poly Dating Sites

  19. Video chat rooms I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article.

  20. I generally check this kind of article and I found your article which is related to my interest. Genuinely it is good and instructive information, matchmaking services san diego Thankful to you for sharing an article like this.

  21. I consider this to be information of quality and it appears to be written so as to make the reader think.  I like your writing style and appreciate your chat now allows two users to connect with each other in a chat room where they can start a chat now without registration. Free chat now with anyone without revealing your identity.


Post a Comment

Popular posts from this blog

Simple car racing android game in Sketchware

Enable Fullscreen for Youtube videos in WebView

Creating a Drawing View in Sketchware

How to enable upload from webview in Sketchware?

List of Calendar Format symbols valid in Sketchware