• Breaking News

    [Android][timeline][#f39c12]

    Thursday, August 30, 2018

    Exploring Spannable Performance Android Dev

    Exploring Spannable Performance Android Dev


    Exploring Spannable Performance

    Posted: 30 Aug 2018 09:20 AM PDT

    Changing theme at runtime. Wrote a little library called DressCode to wrap up what I was doing in my apps. Wanted to get peoples thoughts and ideas to see if its useful for other devs out there?

    Posted: 30 Aug 2018 10:31 AM PDT

    I need some experienced advice about learning the latest technologies on Android to get hired. They gave me 1 month to upgrade my app.

    Posted: 29 Aug 2018 11:00 PM PDT

    Hi fellow Android lovers,

    A bit of context first:

    I've recently published an app on the store to use it as a portfolio for my first job in Android development world.In case you wonder about it, here is the link to the app and here for the GitHub repository.

    The first goal of this app was to actually have something to show to my future employer (most of them ask to have at least one original app on the store). So, I found that job on the internet and they were looking for an Android developer. They wanted an experienced one with 5 years of software development and 1 or 2 year in Android development. I didn't really bother because the job was attractive and of course, I didn't have any of the skill they were asking for. Indeed, I've just been freshly graduated in Bachelor Computer Sciences with an extra class of Android during my last year.

    The surprising part is that they contacted me back within a week! The manager asked me few questions about my motivations, my intentions, my salary expectation etc. via email. Everything went fine, my answers were (I guess) satisfying because he asked for a phone call interview the next day. The phone call went well and he asked me to send him my code's repository to allow his dev team to have a look and contact me back. The next two days, he contacted me back and said that he was OK for a meeting with the dev team in order to assess my technical knowledge, logic and personality.

    I went there, attempted the meeting, everything went fine and the team's age average was around mine which made me even more enthusiast about working with them. We exchanged a few questions about my motivation, the company, the team, the projects etc and I really enjoyed talking with them. Afterwards, I solved the technical trial and had a talk with the manager who asked me to wait a few days for the final answer.

    So, now that you know the context, here comes the problem:

    He said that I was still a junior but they were going to consider my learning curve and motivation by asking me to implement my project with the latest technologies within a month. The dev team's leader asked me to implement the following libraries and techs:

    • Change the language from Java to Kotlin
    • Add MVP layers
    • Add Retrofit
    • Add Dagger
    • Add RxJava (I will ignore this, over-engineered for this project's scope)

    My question is:

    How should I begin? I've been reading a lot about MVP, Dagger, RxJava and honestly it's a bit confusing with all the new annotations. I was planning to use Kotlin (which I've started to understand) with Retrofit first (which is doable quite quickly). But when it comes to Dagger and RxJava, I'm super confused... Without mentioning MVP (I've been spending my last 2 days with 6 hours/day to learn this complicated looking pattern)

    Do you have any recommendation about how to learn these libraries and in which order?I would highly appreciate a complete answer and the reasons behind each choices.

    I'm aware that learning all of these in a month is madness. I believe to not be able to finish this challenge properly but I want to try my best to implement most of them and display the motivation and wish to learn. And anyway, if it doesn't work out, I can still use it for my next job interview. (Even though I really want this one)

    Thanks for reading and for answers!

    EDIT:

    Here are the links so far for the tutorials in case someone is in the same situation:

    submitted by /u/antRobot
    [link] [comments]

    There's no harmony between FAB and Fragments

    Posted: 30 Aug 2018 10:29 AM PDT

    I'm currently working on an application in which I'm trying to implement single activity with multiple fragments, however, the main fragment has a FAB in it, and this is where I found the problem:

    I want to have the scrollable Appbar behavior in the toolbar and the FAB, but since the toolbar resides in the activity, it pushes the fragment down, and the FAB in it accordingly. Also it's awkward to have the behavior in the FAB when it's in a different entity/fragment than the toolbar.

    • First common solution is to put the FAB in the activity, and control it through an interface (for instance: activity implements FabOwner interface). But I find that against the independent nature of the fragments IMO, That means this fragment (if implemented a little bit carelessly) would crash if it's been put in a non FabOwner activity.

    • Another solution would be to embed the toolbar in every fragment, which seems quite painful.

    • The last thing that comes to mind is to use an activity-based approach which would be perfect for FAB's, yet everyone is bashing this approach.

    Any thoughts on that? Thanks!

    submitted by /u/6UpsideDownTrees
    [link] [comments]

    It's only me, or is the Android emulator with api 27/28 very slow again

    Posted: 30 Aug 2018 12:46 AM PDT

    Dear Friends,

    when I create a Virtual Device with android Studio, with api level 27 or 28, the resulting emulator is so slow that it is almost unusable.

    It remembers me the old times, when the android emulator was so slow that the Genymotion emulator whas the option to go.

    I have a good development computer with 32Gb ram, and I configured Android Studio to use as much ram as possible, and the Haxm emulator accelerator too. All my sdk, haxm and so on are up to date. Ssd hard disk, with a powerful CPU.

    The last version of Android Studio (I'm using 3.2 RC2 now), are slow too, sometimes, especially when working with styles. But I suppose that will be solved.

    Someone else is experiencing slowlines or it's just me?

    Thanks and regards!

    submitted by /u/Cylon999
    [link] [comments]

    Kotlin Contracts: Make Great Deals With The Compiler! ����

    Posted: 30 Aug 2018 03:30 AM PDT

    A question about threading in RxJava

    Posted: 30 Aug 2018 09:38 AM PDT

    class MainActivity : AppCompatActivity() { val observableOne : BehaviorSubject<Int> = BehaviorSubject.create() val observableTwo : BehaviorSubject<Int> = BehaviorSubject.create() val observableThree : BehaviorSubject<Int> = BehaviorSubject.create() override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) val threadPool = Executors.newFixedThreadPool(1) val scheduler = Schedulers.from(threadPool) observableOne.observeOn(scheduler).subscribe{ Log.e("MainActivity","ObservableOne $it") } observableTwo.observeOn(scheduler).subscribe{ Log.e("MainActivity","ObservableTwo $it") } observableThree.observeOn(scheduler).subscribe{ Log.e("MainActivity","ObservableThree $it") } observableOne.onNext(1) observableTwo.onNext(2) observableThree.onNext(3) observableOne.onNext(4) }} 

    I've fired events in the order 1, 2, 3, 4 and I want the output to be in that same order.

    But the output I'm getting is 1, 4, 2, 3

    I want to understand how this is happening and how to get it to print in the order I fired the events i.e. 1, 2, 3, 4

    submitted by /u/damnthisplanet
    [link] [comments]

    Reactive implementation of PresentationModel/MVVM pattern in Android. Why use LiveData when there is RxJava?

    Posted: 30 Aug 2018 02:40 AM PDT

    A Text-to-Speech API that doesn't suck

    Posted: 30 Aug 2018 10:53 AM PDT

    I am using android.speech.tts.TextToSpeech, and have noticed that the speaking is really bad. It can't even pronounce ordinary single words like "banana" without sounding ridiculous. I used this same tts a few years ago and remember it being much better.

    submitted by /u/VerySecretCactus
    [link] [comments]

    Room Persistent And RxJava2

    Posted: 30 Aug 2018 12:29 PM PDT

    Room Persistent And RxJava2

    We all want to make our app reactive, less boilerplate code, the power of asynchronous and observable queries. The good news is Room library supports async queries which return LiveData or RxJava2 observable types. The LiveData and Observables allow us to get an automatic update whenever the data changes.

    https://i.redd.it/g45gmo648aj11.jpg

    In this article, you can learn how to work with RxJava2 and Room together, pros of using the Room with RxJava2 and cons of not using it, and in which case which Observable is best. To read more see this article..

    submitted by /u/codinginfinite
    [link] [comments]

    Is there a way to detect a custom rom?

    Posted: 30 Aug 2018 10:26 AM PDT

    First of all, I don't want exclude the users of a custom rom from any feature, rather add one for them. Since many manufacturers include custom battery optimization, I warn the users of a possible presence of this apps, based on the device's brand. But if the user has LineageOS, AOSP, or anything else, it would be pointless. I don't want to go with cheching whether the intents leading to the setting work as they may have changed on that device, in that case I have a warning. Are there any options available, maybe SafetyNet?

    submitted by /u/nadwal
    [link] [comments]

    [TUTORIAL] Video Chat App Android

    Posted: 30 Aug 2018 09:57 AM PDT

    Hi All,

    We are planning to make a tutorial on Video call app in android. Could you please suggest us what are the features you need to have in Video Chat app. So that we will develop a tutorial and publish in our website.

    Thanks,

    Craftide

    submitted by /u/craftide
    [link] [comments]

    Combining database and network call with RxJava2

    Posted: 30 Aug 2018 09:29 AM PDT

    I have 2 data sources: database (cache) and api and I need to combine them into one stream. I know that I can simply use concatArray or something similar but I want to achieve more complicated behavior:

    • Observable stream which will emit up to 2 elements.
    • It will subscribe to both sources in the beginning.
    • If api call will be fast enough (<~300ms), it will emit only data from it and complete the stream.
    • If api call will be slow (>~300ms), emit data from database and still wait for data from api
    • If api call won't succeed, emit data from database and emit an error.
    • If database somehow will be slower than api, it can't emit its data (stream completion solves it)

    I accomplished it with the following code:

    public Observable<Entity> getEntity() { final CompositeDisposable disposables = new CompositeDisposable(); return Observable.<Entity>create(emitter -> { final Entity[] localEntity = new Entity[1]; //database call: disposables.add(database.getEntity() .subscribeOn(schedulers.io()) .doOnSuccess(entity -> localEntity[0] = entity) //saving our entity because //apiService can emit error before 300 ms .delay(300, MILLISECONDS) .subscribe((entity, throwable) -> { if (entity != null && !emitter.isDisposed()) { emitter.onNext(entity); } })); //network call: disposables.add(apiService.getEntity() .subscribeOn(schedulers.io()) .onErrorResumeNext(throwable -> { return Single.<Entity>error(throwable) //we will delay error here .doOnError(throwable1 -> { if (localEntity[0] != null) emitter.onNext(localEntity[0]); //api error, emit localEntity }) .delay(200, MILLISECONDS, true); //to let it emit localEntity before emitting error }) .subscribe(entity -> { emitter.onNext(entity); emitter.onComplete(); //we got entity from api, so we can complete the stream }, emitter::onError)); }) .doOnDispose(disposables::clear) .subscribeOn(schedulers.io()); } 

    Code is a bit clunky and I'm creating here observables inside observable, which I think is bad. But that way I have global access to emitter, which allows me to control main stream (emit data, success, error) in the way I want.

    Is there better way to achieve this? I'd love to see some code examples. Thanks!

    submitted by /u/XchrisXenoipd
    [link] [comments]

    How to kill the wireless charging or battery in android?

    Posted: 30 Aug 2018 09:27 AM PDT

    This problem has been driving me nuts for literally years. I have an app which works with a usb OTG device (arduino nano). and I need to keep the phone charged. (I tried all different kinds of OTG Y cables but it didnt work on many android phones and would often kill the nano connection) So I started using a wireless qi charger since the usb is taken. All works fine until the battery hits 100% at which point android seems to kill the connection with the OTG device thinking its shutting off the charging. Android doesnt seem to know the difference between qi vs usb charging. My only idea at this point was an ugly hack to try to drain more power than the qi put out by detecting battery at 95% and playing a heavy video and put the background to bright but its not quite enough to overcome the qi and still hits 100% OTG death. Any suggestions would be greatly appreciated for either stopping android killing the usb connection or a better way to drain/stop the qi charger.

    submitted by /u/XIMcoincom
    [link] [comments]

    Financial modelling of a startup - server costs. Need help!

    Posted: 30 Aug 2018 09:13 AM PDT

    Hi, I'm sorry for my lack of technical language, but I'm in the process of modelling financial statements for a startup and would really love some input about my problem estimating server costs.

    The startup will be built around an app for mobile devices and the business model resembles a messaging/matching app providing a service similar to uber in some ways. Considering three levels 5M (million), 15M and 30M users (with 10M, 30M and 60M rides per month, respectively) no video or photo storage needs but maybe maps/geolocation services) what's the best way to estimate (pessimistic is better) my tech stack and infrastructure (servers, storage... you name it) costs?

    Any help doesn't need to be too exaustive, I'm just looking for a realistic factor to quantify and determine my cost progression.

    Thank you so much!

    submitted by /u/beardsymcfly
    [link] [comments]

    Is r/thunkable active?

    Posted: 30 Aug 2018 12:58 PM PDT

    I msg'd the mods but haven't heard a thing. (Whether good or bad.)

    submitted by /u/JugglingReferee
    [link] [comments]

    simple ruler library for android, with Calibration and Dimension measurement.

    Posted: 30 Aug 2018 08:49 AM PDT

    Why use Handler/Looper to update UI thread from another thread?

    Posted: 29 Aug 2018 06:19 PM PDT

    If the goal is to run an action in a non-UI thread then update a view in the UI thread... this example from google guide seems so complicated with 3 different classes, and chains of methods to handle the message. Why not just use 1) an AsyncTask or AsyncTaskLoader? 2) Or if one still wants to use Handler, 3) why not just (in the google guide example) in PhotoDecodeRunnable just immediately post a new runnable to the UI thread immediately after decoding the data ...

    Handler handler = new Handler(Looper.getMainLooper()); handler.post(new Runnable() { @Override public void run() { // update a reference to the ImageView with the decoded data? } }); 

    All 3 seem simpler than that example i the google guide

    submitted by /u/baydude510
    [link] [comments]

    Material Design Awards 2018 Entry Form

    Posted: 29 Aug 2018 08:45 PM PDT

    Are build times shorter with android databinding or kotlin synthetics?

    Posted: 30 Aug 2018 06:47 AM PDT

    asking for a friend

    submitted by /u/Dazza5000
    [link] [comments]

    BLE Issue with Redmi note 5 pro

    Posted: 30 Aug 2018 06:46 AM PDT

    What is this component called (sidebar from right). Pardon if wrong place to ask.

    Posted: 30 Aug 2018 06:42 AM PDT

    Google Calendar in Android Studio

    Posted: 30 Aug 2018 02:48 AM PDT

    Hi Guys. I am fairly new to Android programming. I want to access the Google calendar with my app, display the calendar in my app & edit the data.

    I already set WRITE & READ ACCESS, this works. Right now i try to follow

    https://developer.android.com/guide/topics/providers/calendar-provider#sync-adapter

    but i honestly dont understand how the "Query a calendar" section works. Does it return all calendars available?

    Thank you!!

    Edit: I dont know if this is the correct place, is there an Android question subreddit?

    submitted by /u/binilein
    [link] [comments]

    No comments:

    Post a Comment

    Fashion

    Beauty

    Travel