Posts by regmoraes • 2,803 points
92 posts
-
3
votes1
answer284
viewsA: What is the TOGAF?
What is the TOGAF? The The Thethumb drive Group Torchitecture Framework (TOGAF) is nothing more than a framework for creating large/enterprise software architectures. TOGAF is maintained by The Open…
-
13
votes1
answer3213
viewsA: Domain Driven Design, what is the difference between Domain Services, Infrastructure Services and Application Services
Well, the answer to your questions is very similar to the answer to that question. As I ended up answering she will take the liberty of reusing it and supplement it for your case :) Application…
-
5
votes1
answer475
viewsA: What are application and domain services in Onion Architecture?
The main objective of any layer Service is to provide a set of methods that allow the execution of tasks in your software. To perform such tasks services usually need to interact with several other…
-
0
votes1
answer37
viewsA: Layout, Cardview and Recyclerview
You will need both because they serve different purposes. Briefly, the RecyclerView is used to represent data lists, and CardView serves to display data of an item. As to how to use, I suggest the…
-
2
votes1
answer670
viewsA: Unable to instantiate Activity Componentinfo; java.lang.Illegalstateexception: System services not available to Activities before onCreate()
The error occurs because you are trying to access Android components before the Activity is created, ie before the method onCreate() be called. Two examples of these calls illegal are in: public…
-
0
votes1
answer29
viewsA: change global Contant value
By definition of language, any constant (that in java is represented by the modifier final) cannot be changed. If you want a global value, but it can be changed, you should remove the modifier final…
-
0
votes1
answer41
viewsA: Google Play Billing Library
Once the method onPurchasesUpdated arrived at the call of the method handlePurchase() means that the purchase has already been successfully made and processed in the Play Store (hence the…
-
0
votes1
answer67
viewsA: Constraint Bugado Layout
Try putting the TextViews below the play buttons (ImageButtons), instead of below the SeekBars. For that, in each TextView change app:layout_constraintTop_toBottomOf="@+id/seekBarAcima" /> for…
-
1
votes2
answers183
viewsA: Instantiated object does not appear in function
You have a scope problem. When you declare new variables in a method, they only belong to that method. If you want a variable to be accessed by all methods of a class, you have to declare (if you…
-
2
votes1
answer237
viewsA: Why inflate a Layout in Fragments instead of setting one already ready? Ex: setContentView(R.layout.activity_example)
The LayoutInflater is the class responsible for creating a View from an XML file, therefore, you need it to instantiate and access a View. In Fragments, like the onCreateView() requires a View…
-
1
votes1
answer48
viewsA: Creation of a Splash
It is not very good to use Splash Screens, because it slows down the time it takes to open the app, and users don’t like slow apps. However, if you need to do some processing (check credentials,…
-
1
votes1
answer49
viewsA: Is there any standard for documentation of the architecture of an android application?
To document the architecture of any software project, the ideal is to use the UML, because it is a language well known and that provides all the elements to represent elements of software. To…
-
3
votes2
answers53
viewsA: Doubt Listview
Note that the class builder ArrayAdapter wait as parameter: A context A layout that will be used to represent each item in the list. This layout, by default, must have a Textview A list of objects…
-
4
votes1
answer430
viewsA: How do I place Edittext in the middle of the screen?
When you call vetorEdits[i].setGravity(Gravity.CENTER); , you are centering only the content of EditText To center itself EditText in relation to the LinearLayout, you must do the following…
-
1
votes2
answers2397
viewsA: How to fix APK error completely hidden?
As pointed out by Thiago Luiz Domacoski, to publish a new APK on Google Play, the value of the versionCode in your Gradle, must be higher than the value of the last published APK. defaultConfig { /*…
-
2
votes1
answer2285
viewsA: What is the best method to create forms in Adroid?
Frankly, this is a matter of UX+UI. You can even use the components of Material Design to follow Uideline, but how these components will be organized and their style is up to you to decide.…
-
3
votes1
answer103
viewsA: Android Start My App Only
Briefly ... Not Android is an operating system and your app is just a process that runs on it, you just can’t lock all the features exclusively into your app. Even if you try to do this, one time or…
-
2
votes1
answer69
viewsA: Error while adding Progressidialog
Try this code to show an indeterminate progress bar that shows a spinner: dialog = new ProgressDialog(DebitosPendentesActivity.this); dialog.setIndeterminate(true); dialog.setMessage("Enviando…
-
1
votes1
answer146
viewsA: How to pass drawable file as parameter?
Instead of you passing Drawable as a parameter, you can only pass the Resource ID and then instantiate Drawable in the other Activity using this Resource ID. It is good to know that passing an…
-
2
votes2
answers4548
viewsA: What’s the difference between Assets, res and raw directories on Android?
Assets/ You can use this folder to store any file. The files you save here are compiled in the .apk and the name of the original file is preserved. You can browse this directory in the same way as a…
-
2
votes1
answer84
viewsA: onClick on the menu
The mistake java.lang.Nosuchmethodexception: 'meuMetodo()' occurs when the method meuMetodo() not declared inside its class / interface. In your case, every time you put the line…
-
0
votes2
answers426
viewsA: Save photo via URL to database
Since you are working with Facebook data, you do not need to save the Facebook photo itself in your database, just the photo URL ( save as a string). Saving the photo in your database is a bad idea…
-
0
votes1
answer116
viewsA: Error "[ ] cannot be converted to JSON" when trying to create Jsonobject from String
I found the error, and unfortunately, it had nothing to do with transforming String into a JSON Object, but in converting the properties of the User class to a JSON String My job was the following…
-
0
votes1
answer116
viewsQ: Error "[ ] cannot be converted to JSON" when trying to create Jsonobject from String
I am using the Kotlin language together with the GSON library to perform JSON object creation/parse. I have the following string that caches a JSON object returned from a server val jsonString =…
-
5
votes3
answers617
viewsA: Create temporary lock on the app
The solution that @Paulogustavo gave us in the comments is a good one, but I would make a small change: You’d better validate the method onResume() of Activity, since that method is always called…
-
3
votes1
answer1616
viewsA: How to use the power button on your phone?
First, add the following to your Android Manifest <uses-permission android:name="android.permission.PREVENT_POWER_KEY" /> Then, in your Activity that will capture the click events, put the…
-
2
votes2
answers224
viewsA: Error using sendMessage() method of the Handler class. "Message not posted or already removed"
Running background code on Android using Handlers and Threads is an often complicated and error-prone task, because a special class has been created to facilitate the execution of asynchronous…
-
1
votes1
answer73
viewsA: Capture in Loop the value of a variable of another Activity
What you are trying to do, as far as I know, is not possible, as each Activity has its own context ( feature set and own classes), moreover, it is only possible to run one Activity at a time, so it…
-
5
votes1
answer2073
viewsA: How to automatically run a method outside of Activity onCreate()
As @Igormello said, you should use one Async Task. Basically, what a Async Task does is execute a code in a thread other than Uithread, which is the main thread and is responsible for building…
-
1
votes1
answer131
viewsQ: Kotlin - How to play the effect of "lateinit" on a "var" of an interface?
I have an interface called UserManager who owns a var of the kind User interface UserManager { var user:User /* ... */ } and a class called UserManagerImpl implementing UserManager class…
-
4
votes3
answers3871
viewsA: How to put hint on a spinner?
Complementing @Caiqueoliveira’s reply: To achieve the desired effect you can do the following Create a string array where the first element is hint Use the following code for Adapter final…
-
2
votes1
answer120
viewsA: I can’t change the layout on android
Once you call the method setContentView() passing a layout as parameter, you can only manipulate and instantiate the elements of this layout, so once you called setContentView(R.layout.teste) you…
-
0
votes1
answer56
viewsA: android - Chargeback app payment in alpha
Retrieved, adapted and translated from official Android documentation: Cancellation of completed test purchases Google Play accumulates completed trial purchases for each user, but does not pass…
-
0
votes1
answer29
viewsA: Maps.getPhoto()' on a null Object Reference
logcat already tells what the error is Nullpointerexception: Attempt to invoke virtual method 'int Maps.getPhoto()' on a null Object Reference That is, you are calling the method getPhoto() of an…
-
3
votes3
answers3605
viewsA: Problems with getSupportActionBar() to Home (arrow) button and back arrow
To reset what happens when you click the button Back of Navigation Bar (2), you must rewrite the following method in your Activity: @Override public void onBackPressed(){ Intent mIntent = //Crie a…
-
1
votes1
answer84
viewsQ: Show an application A within the Fragment of another application B
In my app, when the user clicks Add Contact I call the Contacts app using a Intent. But instead, it would be possible to open a Fragment whose content would be the Contacts app itself, i.e., show…
-
1
votes1
answer101
viewsA: Android/IOS vs Java
In short, the ideal is for you to create a REST API and a data representation standard so that both your mobile app and your app can share information with each other. This information can be…
-
4
votes2
answers461
viewsA: Problem removing element from a chained list
A simpler way is to use a recursive method. This way, you will pass as parameter the first element of the list and the note you want to search for to remove. An example: Aluno removeAluno(Aluno…
-
3
votes2
answers159
views -
4
votes1
answer842
viewsA: Is there a graphical interface Apis for Graphs on android?
To perform graph plotting on Android, you can use these libraries: Mpandroidchart - Powerful library for graph and graph visualization Achartengine - Graphical library for Android applications…
-
0
votes1
answer47
viewsA: Error compiling Dagger 2 in Eclipse
Dagger no longer generates classes with "_", so replace Dagger_Coffee for DaggerCoffee and then give a Rebuild in the project.
-
3
votes1
answer83
viewsA: Implement contact editing after saving to the database
When you want to edit a contact from an application, what is usually done is the following: By clicking on a contact from a contact list, a new edit screen ( Activity or Fragment ) with the contact…
-
0
votes1
answer45
viewsA: Use android layout randomly
You don’t need to pass a View pro method setContentView(). This method also accepts a int as a parameter, this being int is the id the layout you want to use. So what you can do is find the id…
-
0
votes1
answer54
viewsA: How to implement UI like the recent Lolipop
First, it is important to know that Android Lollipop uses the Material Design, which is a set of practices and design patterns ( colors, icons, typography, animations, layouts, etc). Therefore, if…
-
3
votes2
answers930
viewsA: What does "serialVersionUID" mean?
The serialVersionUID is a universal version identifier for a class Serializable. In deserialization, this number is used to ensure that a loaded class corresponds exactly to a serialized object. If…
-
2
votes1
answer2043
viewsA: Is there a keyword rule in Google Play?
To make your app appear at the top of Google Play searches, you should take advantage of Google Play’s search and rankings algorithm - as it will determine how high up your app should appear - and…
-
3
votes1
answer2711
viewsA: How to access agenda on android and select contact
You’re doing it right, you need to use an Intent to access the application Contact Book android. What remains to be done is to access the contacts in Agenda and return them. First, you must have a…
-
2
votes2
answers928
viewsA: Best practices in the interaction between Activities
To make your app smaller and smoother in the transition and display of screens, I recommend you use the combination Activity + Fragments. Fragments can be understood as a sub activity, that is, a…
-
0
votes1
answer199
viewsA: Asynchronous chat on Android
Well, there are several ways to implement a chat on Android. In most cases you will need to use at least: An application on a server to host and manipulate data ( users, messages, etc. ) Gogle CLoud…
-
3
votes2
answers561
viewsA: How to avoid automatic closing in Dialogfragment?
Put the following code in the method onCreateView() of your DialogFragment getDialog().setCanceledOnTouchOutside(false);