About the author

I am an Android developer for whom Android is the one and only love. I work as a freelancer which gets me and Android closer. I always love to share my learnings and love to learn from others knowledge too.

COMMENTS (67)
Reply

i have a problem with the text_selector.xml

it says an expected resource of type xml, i dont know whats the problem.
so, help ASAP

Reply

it also says do login for that valid email id and pass which i haven’t registered in this signup.. why? and also where we ‘ll get forgot password?

    Hi Ishal,

    This article is about only UI of Login, Signup Screens. Here no coding for registering user or forgot password. The error or message that you are getting to valid email id and password is because i put validation that email id and password should be entered and email should be in proper format.
    For proper functionality you have to do server side coding in php, .net or any other then that API you have to integrate with it.

    Thanks

Reply

how i can login and signup activities with MSSQL server and go to user profile after successful login?

Reply

Hello Sir,
I added imageview inside login_layout with png image(56,4 kB) then I got some lag with the animation.
How can to solve this ?
This is my imageview content :

Best Regards

Reja

    Hi Reja,

    You are putting Image directly to your root layout which is not correct way. Use below method to compress and scale the bitmap:

    public static Bitmap convertDrawableIntoBitmap(Context context, int resID, int width, int height) {
    Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(), resID);
    return Bitmap.createScaledBitmap(bitmap, width, height, true);
    }

    The above method will return you Bitmap which you have to set to an ImageView.
    So if you had taken your root Layout as Linear or Relative inside that use ImageView with full height and pass the Width and Height of you current screen size.

    In this way you can avoid animation lag.

    Thanks

Reply

Hello Sir,
Thank you for your help,
Your solution decrease the animation lag, but I feel some animation delay for that animation.
When I’m go to signup_layout more fastest to load than login_layout. Also forgotpassword_layout more fastest to load than login_layout.
How can to solve this ?
Sorry for my bad english before.

Best Regards,

Reja

    Hi Reja,

    If you want to delay or make fast your animations then you have to change the duration of the animation which is given in animation xml files with attribute duration. Right now its 300ms duration which you can modify according to your need.

    Thanks

Reply

Hello Sir,
Thank you for your solution.
You saved my day..

Best Regards
Reja

Reply

how can i connect this app to my data base ?

Reply

This is with reference to your url for Login UI, Signup and forgot password UI http://www.androhub.com/login-signup-and-forgot-password-screen-design-android/

Since I’ve been following your tutorial my work is going pretty well, but I’m facing a little bit problem in ForgotPassword.xml as the page is done but whenever I click on the edit text to type the keypad appears resulting in to hiding of my edittexthint due to which I’m unable to see what I’m typing. I’ve followed the same for the xml code but don’t know why it is happening.

This is problem I’m facing, link is given below :
https://drive.google.com/open?id=0B8fdRh5_PUJCYmRERDI0M2ZtN0E

Thank you so much!

    Hi Alok,

    You are using custom background to your EditText which causes hiding Hint Text. So remove your custom background and try it will work.

    Thanks

Reply

android:drawableStart=”@drawable/password”
Error showing in drawable paasword in login_layout.xml

    Hi Siddhant Raj,

    Please check do you have any drawable with name password in drawable folder or not. The error is due to non availability of requested drawable.

    Thanks

Reply

My application is showing two errors and I am unable to resolve them.

Application is showing blank screen with the cross mark on top right side
and replaceLoginFragment(); in showing error.

    Hi Shubham,

    Can you please share more details :
    1. Share your xml file which is showing blank screen with cross mark.
    2. Share your Logs to know the actual error coming while replaceLoginFragment().

    Thanks

Reply

Getting an error:

Cannot resolve symbol ‘@anim/cycle’
Cannot resolve symbol ‘R’

Please help!

    Hi Adeel,

    You have not created cycle xml under anim directory. So please create an cycle xml which you can get from this article if you will find Cycle Animation. Add the cycle animation and rebuild your project your problem will get resolved.

    Thanks

Reply

dear Dr.Ddroid..
can u give me a new link to download the souce code? ican’t download the source code. thx

    Hi Dewi157,

    I tried downloading with same link and able to do so. Can you please try again and if still it is not downloading then share your email id so that i will send you code via email.

    Thanks

Reply

Hi Dr.Droid ..

I have tried this example of login . I am finding two errors i.e
1.I am getting a error in java class of Signup_Fragment.java and ForgotPassword_Fragment.java the error is
XmlResourceParser xrp = getResources().getXml(R.drawable.text_selector);– I am getting error for R.drawable.text_selector
2.I cannot find the file name replaceLoginFragment. // Replace Login Fragment on Back Presses
new MainActivity().replaceLoginFragment();

    Hi Aakash,

    Below are the solution for your questions:
    1.I am getting a error in java class of Signup_Fragment.java and ForgotPassword_Fragment.java : Remove the line which is creating error because that code is deprecated.
    2.I cannot find the file name replaceLoginFragment. // Replace Login Fragment on Back Presses : You need to create the replaceLoginFragment method in your MainActivity. Please check your code again.

    Thanks

Reply

Hi Dr.Droid thank you for your support , I have got the output but can you help me out with the email validation which you have provided in Utils.java I was getting error so I have modified it in order to get the output . And also can you help me out connecting with sql server database .

Reply

Dr.Droid,
I am getting in this regular expression “\b[A-Za-z0-9._%+-][email protected][A-Za-z0-9.-]+\.[A-Za-z]{2,4}\b”; , It is giving illegal escape character in string literal near (+\.) and thanks for the database example.

    Hi Aakash,

    I don’t know why email regular expression is creating issue in your project. Can you try below provided regular expression and check whether its working or not:

    String emailPattern = “[a-zA-Z0-9._-][email protected][a-z]+\\.+[a-z]+”;

    Thanks

Reply

Dr.Droid ,

It is giving more errors in the expression .No problem I will try it out .but , thanks for your support..

Reply

sir….you are great…. thanx a lot…

Reply

Error:(140, 38) error: cannot find symbol variable frameContainer ………sir how to fix this.

    Hi Fawad,

    Please check your code again and see if you have added FrameLayout in your activity_main.xml and give id as frameContainer to it.
    You can check point number 4. above.

    Thanks

Reply

Hi, Great Work, But it is connecting with database or not?

    Hi Jimmy,

    Unfortunately no. Actually this is just design screens.

    Thanks

Reply

“resource color/colorPrimary (aka com.devilco.myapplication:color/colorPrimary) not found.”
Dr. Droid i’m getting the above error repeatedly please give me a solution

    Hi Shreenag,

    Download my source code and go to colors.xml there you will find one colorPrimary copy that color code and paste it into yours then try. It will work.

    Thanks

Reply

the app runs with no error but it doesnt pass the activity_main.xml just shows the green screen

    Hi Arjun,

    Can you show me your code that you had done so that i can help you better.

    Thanks

      give your mail id please

Reply

Hi Sir,
I did all the coding accordingly , but the problem is aftr running the app its just shuts down the app does not open. No error nothing. Why is this happening

    Hi Savio,

    That means your app is crashing. Try to check the logs and share with me.

    Thanks

Reply

Hi Droid,

Can you please share the code of MainActivity.java file please?

Thanks,
Rajat

    Hi Rajat,

    Download the source code. Everything is inside in that download code.

    Thanks

Reply

Hi Drio,

Initially, it worked to show just green screen with a cross icon on the top right corner but now the application is getting crashed. In the main activity.java, we have the following imports written:

import com.login_signup_screendesign_demo.R;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.View.OnClickListener;

Is this happening due to the different versions used here v4 and v7? If yes, what change is required to be done to get the app working?

Thank you,
Rajat

    Hi Rajat,

    It seems that your imports are correct. Can you share your logcat so that we can know exact issue.

    Thanks

Reply

08-10 10:18:55.416 2652-2652/? I/art: Not late-enabling -Xcheck:jni (already on)
08-10 10:18:55.433 2652-2658/? E/art: Failed sending reply to debugger: Broken pipe
08-10 10:18:55.433 2652-2658/? I/art: Debugger is no longer active
08-10 10:18:55.550 2652-2652/? I/InstantRun: starting instant run server: is main process
08-10 10:18:55.663 2652-2652/? W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
08-10 10:18:55.729 2652-2652/? I/art: Rejecting re-init on previously-failed class java.lang.Class
Rejecting re-init on previously-failed class java.lang.Class
08-10 10:18:55.826 2652-2667/? I/art: Background sticky concurrent mark sweep GC freed 2130(436KB) AllocSpace objects, 0(0B) LOS objects, 26% free, 1439KB/1968KB, paused 7.098ms total 24.455ms
08-10 10:18:55.929 2652-2652/? D/AndroidRuntime: Shutting down VM

——— beginning of crash
08-10 10:18:55.930 2652-2652/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.gps.prabodh.gpsdriver, PID: 2652
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.gps.prabodh.gpsdriver/com.gps.prabodh.gpsdriver.MainActivity}: java.lang.RuntimeException: Unknown interpolator name: set
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
at android.app.ActivityThread.access$800(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
Caused by: java.lang.RuntimeException: Unknown interpolator name: set
at android.view.animation.AnimationUtils.createInterpolatorFromXml(AnimationUtils.java:362)
at android.view.animation.AnimationUtils.loadInterpolator(AnimationUtils.java:273)
at android.view.animation.Animation.setInterpolator(Animation.java:391)
at android.view.animation.Animation.(Animation.java:255)
at android.view.animation.TranslateAnimation.(TranslateAnimation.java:54)
at android.view.animation.AnimationUtils.createAnimationFromXml(AnimationUtils.java:124)
at android.view.animation.AnimationUtils.createAnimationFromXml(AnimationUtils.java:116)
at android.view.animation.AnimationUtils.createAnimationFromXml(AnimationUtils.java:93)
at android.view.animation.AnimationUtils.loadAnimation(AnimationUtils.java:74)
at com.gps.prabodh.gpsdriver.Login_Fragment.initViews(Login_Fragment.java:70)
at com.gps.prabodh.gpsdriver.Login_Fragment.onCreateView(Login_Fragment.java:51)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:2435)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1460)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852)
at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:802)
at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2625)
at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2411)
at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2366)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2273)
at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3273)
at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3229)
at android.support.v4.app.FragmentController.dispatchActivityCreated(FragmentController.java:201)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:610)
at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:178)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1220)
at android.app.Activity.performStart(Activity.java:5953)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2261)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360) 
at android.app.ActivityThread.access$800(ActivityThread.java:144) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:135) 
at android.app.ActivityThread.main(ActivityThread.java:5221) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694) 
08-10 10:19:04.571 2652-2652/? I/Process: Sending signal. PID: 2652 SIG: 9

    Hi Rajat,

    The issue is in your animation you are using some unknown interpolator. Try removing animation or use correct interpolator.

    Thanks

Reply

Below are the comments in ‘Event log’ section?

8/10/2018
5:39 PM Gradle sync started

5:39 PM Project setup started

5:39 PM Gradle sync finished in 2s 459ms (from cached state)

5:41 PM Executing tasks: [clean, :app:assembleDebug]

5:41 PM Gradle build finished in 44s 161ms

5:42 PM * daemon not running; starting now at tcp:5037

5:42 PM * daemon started successfully

5:42 PM Executing tasks: [:app:assembleDebug]

5:42 PM Emulator: audio: Failed to create voice goldfish_audio_in'

5:42 PM Emulator: qemu-system-x86_64.exe: warning: opening audio input failed

5:42 PM Emulator: audio: Failed to create voice adc’

5:42 PM Gradle build finished in 17s 193ms

5:43 PM Emulator: Process finished with exit code 0

5:43 PM Executing tasks: [clean, :app:generateDebugSources]

5:44 PM Gradle build finished in 12s 242ms

5:44 PM Executing tasks: [clean, :app:assembleDebug]

5:44 PM Gradle build finished in 16s 645ms

5:45 PM Executing tasks: [:app:assembleDebug]

5:45 PM Gradle build finished in 1s 594ms

5:45 PM Build APK(s)
APK(s) generated successfully:
Module ‘app’: locate or analyze the APK.

5:45 PM Executing tasks: [:app:assembleDebug]

5:45 PM Emulator: audio: Failed to create voice goldfish_audio_in'

5:45 PM Emulator: qemu-system-x86_64.exe: warning: opening audio input failed

5:45 PM Emulator: audio: Failed to create voice adc’

5:45 PM Gradle build finished in 13s 661ms

5:46 PM Emulator: Process finished with exit code 0

5:47 PM Executing tasks: [clean, :app:assembleDebug]

5:47 PM Gradle build finished in 21s 786ms

5:47 PM Executing tasks: [:app:assembleDebug]

5:47 PM Gradle build finished in 1s 976ms

5:48 PM Executing tasks: [:app:assembleDebug]

5:48 PM Emulator: audio: Failed to create voice goldfish_audio_in'

5:48 PM Emulator: qemu-system-x86_64.exe: warning: opening audio input failed

5:48 PM Emulator: audio: Failed to create voice adc’

5:48 PM Gradle build finished in 13s 506ms

5:49 PM Emulator: Process finished with exit code 0

Thanks,
Rajat

Reply

Hi can you please share this full code in my gmail .

[email protected]

Please
Thanks in advanced

    Hi Ishraj,

    You can find source code at the end of the Post.

    Thanks

Reply

sir this code is stoping the progect

    Hi Sai,

    Can you share the logs so that we get to know what is causing the issue?

    Thanks

Reply

Hello,

Am getting error in java file regarding package (the very first line )and import.R due to which its showing error in all java files.

Kindly help me .

Thank you

    Hi Yadnika,

    Please clean and rebuild your project and replace package name with your one.

    Thanks

Reply

Hello,

am facing problem with java files the package name error .

Kindly help me.

Reply

error: cannot find symbol variable toast_root
error: cannot find symbol variable toast_error
I am getting above two error so please help me out

    Hi Suraj,

    Please add custom_toast.xml(Step-10) into your layout.

    Thanks

Reply

error: cannot find symbol variable toast_root
error: cannot find symbol variable toast_error
I am getting these above two error in CustomToast.java file please help me

Reply

thanks for your reply man

Reply

I want to go to another navigation drawer activity after login but when i m putting intent where you display toast “do login” it is showing application unfortunately stopped. so please help me Dr. Droid

    Hi Suraj,

    Can you send me Logcat so that i can check what is causing exception?

    Thanks

Reply

Great Post Droid, keep Sharing.. 🙂

Reply

I am getting error of lot of time missing in drawable like below, please help.

Output: D:\My_Projects\Andriod\mobile\src\main\res\layout\activity_main.xml:14: error: resource drawable/close (aka com.example.sachi.helloworld:drawable/close) not found.
D:\My_Projects\Andriod\mobile\src\main\res\layout\signup_layout.xml:18: error: resource drawable/user (aka com.example.sachi.helloworld:drawable/user) not found.
D:\My_Projects\Andriod\mobile\src\main\res\layout\signup_layout.xml:40: error: resource drawable/email (aka com.example.sachi.helloworld:drawable/email) not found.
D:\My_Projects\Andriod\mobile\src\main\res\layout\signup_layout.xml:62: error: resource drawable/phone (aka com.example.sachi.helloworld:drawable/phone) not found.
D:\My_Projects\Andriod\mobile\src\main\res\layout\signup_layout.xml:84: error: resource drawable/location (aka com.example.sachi.helloworld:drawable/location) not found.
D:\My_Projects\Andriod\mobile\src\main\res\layout\signup_layout.xml:106: error: resource drawable/password (aka com.example.sachi.helloworld:drawable/password) not found.
D:\My_Projects\Andriod\mobile\src\main\res\layout\signup_layout.xml:128: error: resource drawable/confirm_password (aka com.example.sachi.helloworld:drawable/confirm_password) not found.
error: failed linking file resources.

    Hi Sachi,

    Please download the source code and inside the source code you will find all drawables. Copy and paste that drawables into your project.

    Thanks

Leave a Comment

Comment (required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

Name (required)
Email (required)