• Breaking News

    [Android][timeline][#f39c12]

    Friday, April 20, 2018

    Weekly "anything goes" thread! Android Dev

    Weekly "anything goes" thread! Android Dev


    Weekly "anything goes" thread!

    Posted: 20 Apr 2018 05:41 AM PDT

    Here's your chance to talk about whatever!

    Although if you're thinking about getting feedback on an app, you should wait until tomorrow's App Feedback thread.

    Remember that while you can talk about any topic, being a jerk is still not allowed.

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

    How long you can work on Android Studio? On MBP 13 2017 TB it lasts only 2 hours.

    Posted: 20 Apr 2018 04:37 AM PDT

    Create a promo-video for the play-store - Sharing learnings

    Posted: 20 Apr 2018 07:33 AM PDT

    Emulator 27.2.6 Canary

    Posted: 20 Apr 2018 03:48 PM PDT

    [DEV] A simple pull to refresh library

    Posted: 20 Apr 2018 06:26 AM PDT

    What's a sensible shortlist of topics that an entry-level Android dev should know?

    Posted: 20 Apr 2018 02:08 PM PDT

    Hi guys, I'm a recent college grad and, like many who post here, I'm trying to improve my Android/Java skills to where I'd be a standout job candidate for entry-level positions.

    I'm trying to create a shortlist of topics that can be used as a 'roadmap' or checklist to keep a learning Android dev's path on track.

    Here's what I've got so far. This list is based on my readings/conjecture and could be completely inaccurate:


    • Have an understanding of Object-Oriented Programming in Java
      • Know Abstraction, Encapsulation, Inheritance, Polymorphism and the benefits of each
      • Have some experience working with asynchronous programming using Callbacks, Listeners, etc.

    • Understand the Activity lifecycle
      • Know the role of each on(Something) method, when it is called
      • Know how to use Fragments, their lifecycle, and how they differ from Activities
      • Learn some best practices of when the view should be updated
      • Learn how to manage orientation changes and some best practices associated

    • Learn about App Architecture Components (Why/Why not to use them, strengths/weaknesses)
      • Room
      • ViewModel
      • LiveData
      • Paging

    • Knowledge of some design architecture (pick one and know how to implement it)
      • Model-View-Presenter (MVP)
      • Model-View-ViewModel (MVVM)
      • Model-View-Intent (MVI)

    • Learn some Layout design best practices
      • Learn some Google Material Design principles

    • Work with managing images
      • Use popular libraries such as Picasso, Glide

    • Work with RESTful APIs
      • Know HTTP methods (GET, POST, etc.), what their purpose is
      • Use popular libraries such as OkHttp, Retrofit

    • Work with SQL/relational databases
      • Create and use a SQLite database
      • Used PreparedStatements (SQLiteStatement in Android's case)
      • Learn object-relational mapping, its advantages/disadvantages vs. raw SQL

    • Understand some commonly used design patterns (based on Gang of Four)
      • Factory / Abstract Factory
      • Builder
      • Observer
      • Singleton
      • Adapter
      • Iterator
      • Interface

    • Know how to test/debug effectively
      • Understand test-driven development
      • Write unit tests
      • Use JUnit, Mockito

    • Become comfortable using Android Studio
      • Know some shortcuts
      • Can use quality-of-life options such as code generation, find-usages, go-to, etc.

    • Extra Credit
      • Have some experience working with RxJava
      • Learn how any of the above things are done in Kotlin, and the possible benefits of the Kotlin implementation

    I'd love to hear your opinions on what should be added/removed.

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

    Need Advice on a new app I'm working on. Should the alpha users of an app be given premium features for free? If Yes, what strategies can I use to do that?

    Posted: 20 Apr 2018 11:32 AM PDT

    Hi Devs,

    I'm working on a new app for Pocket. I'll be releasing it in alpha to the play store soon. What I couldn't decide on was should I give the alpha users who will probably give invaluable feedback about the app the premium features for free?

    If yes, how can I go about doing that? One strategy I thought of was showing a survey in the app in the first 2 weeks while all the premium features are open, post which it'll be paid. If a user completes the survey, I give the user a promo code.

    How else can I encourage feedback for the app and give those users the all the features for free?

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

    [Talk] How Proguard Works by Jeb Ware at Droidcon Boston 2018

    Posted: 20 Apr 2018 04:19 AM PDT

    A simple blog application with posts/comments and user detail demonstrating MVP clean architecture in Kotlin.

    Posted: 20 Apr 2018 09:28 AM PDT

    [QUESTION] Is there any reason to take the Android Development Nanodegree by Google(java) in Udacity if the first thing I see in the Android dev site is: "Kotlin is now an official language on Android." ?

    Posted: 20 Apr 2018 09:05 AM PDT

    Title.

    If not... Any good alternative?

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

    Zooming in/out Canvas using ScaleGestureDetector on Android results in jumpiness of viewport (camera)

    Posted: 20 Apr 2018 02:11 PM PDT

    I'm developing a Flowchart drawing app and I implemented a zoom in/out by pinching mechanic using ScaleListener and onTouch function.

    The problem is that when I zoom in, it does not zoom into the mid point of my two fingers, it zooms towards the corner of the screen.

    Plus, like 3 out of 10 times I pinch in or out, after the scaling is done, camera (viewport, the visible area of the canvas/view) jumps to somewhere else. Somewhere close, so it's usable anyway but it feels jumpy. How can I fix that?

    Here's the code I wrote:

    private class ScaleListener extends ScaleGestureDetector.SimpleOnScaleGestureListener { @Override public boolean onScale(ScaleGestureDetector detector) { if (selectedShape != null){ float shapeScaleFactor = detector.getScaleFactor(); selectedShape.scale(Math.max(0.2f, Math.min(shapeScaleFactor, 1.5f))); } else { scaleFactor *= detector.getScaleFactor(); scaleFactor = Math.max(0.1f, Math.min(scaleFactor, 1.0f)); scaleX = detector.getFocusX(); scaleY = detector.getFocusY(); } invalidate(); return true; } } 

    Along with this onTouchEvent function:

    public boolean onTouchEvent (MotionEvent event){ scaleGestureDetector.setQuickScaleEnabled(true); scaleGestureDetector.onTouchEvent(event); final int action = event.getAction(); float[] coords = new float[2]; coords[0] = event.getX(); coords[1] = event.getY(); Matrix matrix = new Matrix(); matrix.set(getMatrix()); matrix.preTranslate(posX, posY); matrix.preScale(scaleFactor, scaleFactor); matrix.invert(matrix); matrix.mapPoints(coords); final int x = Math.round(event.getX()); final int y = Math.round(event.getY()); cX = Math.round(coords[0]); cY = Math.round(coords[1]); switch (action & MotionEvent.ACTION_MASK){ case MotionEvent.ACTION_DOWN: { startClickTime = Calendar.getInstance().getTimeInMillis(); lastX = x; lastY = y; break; } case MotionEvent.ACTION_MOVE: { if (!scaleGestureDetector.isInProgress()){ final int dX = (x - lastX); final int dY = (y - lastY); if (selectedShape != null){ selectedShape.translate(Math.round(dX / scaleFactor), Math.round(dY / scaleFactor)); } else { posX += dX; posY += dY; } } lastX = x; lastY = y; invalidate(); break; } case MotionEvent.ACTION_UP: { long clickDuration = Calendar.getInstance().getTimeInMillis() - startClickTime; if (clickDuration < MAX_CLICK_DURATION && !scaleGestureDetector.isInProgress()){ // Kullanıcı sadece dokundu. Nereye dokunduğuna bakılmalı. boolean flag = false; // Bir şekle dokunduysa o şekil seçili olmalı. for (Shape shape : shapes){ if (shape.contains(new Point(cX, cY))){ select(shape); flag = true; } } // Boş alana dokunuldu, önceden seçilmiş olan şekil artık seçili olmamalı. if (!flag){ if (selectedShape != null) selectedShape.setSelect(false); selectedShape = null; } } invalidate(); } } return true; } 

    OnDraw:

    @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); this.canvas = canvas; canvas.save(); canvas.translate(posX, posY); canvas.scale(scaleFactor, scaleFactor); for (int a = -10; a < 10; a++) { for (int b = -10; b < 10; b++) { canvas.drawLine(1000 * a, -10000, 1000 * a, 10000, paint); canvas.drawLine(-10000, 1000 * b, 10000, 1000 * b, paint); } } for (Shape shape : shapes){ shape.drawThis(); } canvas.restore(); } 
    submitted by /u/AdigeWottah
    [link] [comments]

    SQLite - UPSERT available in pre-release

    Posted: 20 Apr 2018 04:06 AM PDT

    Got in contact with a recruiter. Does this seem fishy?

    Posted: 20 Apr 2018 01:03 PM PDT

    I'm talking with a recruiter on linkedin from a company with no website, she says the website went down for redesigning a couple of months ago.

    She says she likes my portfolio and resume that I emailed to her (a gmail). Now, on linkedin messenger, she is asking for id (proof that I'm a US citizen). What do I do? How can I confirm this isn't a scam? Is this normal?

    I value my identity. It's served me well for many years. I'd like to hold onto it.

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

    Confused with android maps api premium?

    Posted: 20 Apr 2018 12:25 PM PDT

    Hello

    I've done a bit of reading already but due to my lack of development knowledge, I'm not sure I comprehend what I've read correctly.

    I'll briefly explain the app I'm trying to do and if someone can help me know if I can get away with the free version or not, that would be great.

    I want to build a bus tracker for a school here in Egypt. It's my a relative's idea, as he is the bus fleet manager. I think I'm not gonna get paid for this and it'll sort of be just a reason to learn android development as I've been procrastinating it for a while. I was thinking of building a two set app. One for the bus and one for the users which are the parents. They login with their accounts and they'd have access to their child's school bus and its position on a map.

    When I looked on the google maps api, it seems like this goes under asset tracking which is only available under the premium version. The issue is the premium version is for $10k per 100 vehicles per year. That's roughly 180,000 EGP (egyptian currency). So I was considering monetising the app to different schools to cover this. As design engineer in Egypt, I make 60,000 EGP. Given that the economy here is in a dump, I won't be able to cover the cost that is placed on foreign countries with better economies.

    So basically my questions are can I get away with the free version, would google calculate a different price given my location, are there cheaper alternatives that aren't too much of a hassle?

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

    Android O - How to broadcast a custom intent?

    Posted: 20 Apr 2018 05:12 AM PDT

    Hey, I am building a feature that relies on custom broadcast intents. In previous Android versions, I used to register the broadcast receiver in Manifest.

    When, I need to trigger an event I used to fire a broadcast using sendBroadcast("my_custom_intent"). This worked pretty well for Nougat, Marshmallow etc but just doesn't work on Oreo.

    I know that Oreo has background execution limits but I am unable find a suitable replacement.

    Do you guys know anything similar?

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

    How are you doing your network calls (looking for best practices)?

    Posted: 20 Apr 2018 03:23 AM PDT

    Okay, there are actually a lot of articles, etc. covering parts of this topic, but I'd like to gather real-life working "combos", so to speak.

    I used a library called Robospice and was pretty happy with it because it:

    • handled background processing
    • handled orientation changes, you could check if your request is in progress/finished and resubscribe to get result when activity is recreated
    • handled network outages and automatic retries with exponential delays

    Now this pretty old library is dead (literally), and I'm looking for alternatives which will help me to implement everything mentioned above.

    Many articles show basic examples with rxjava + okhttp/retrofit, but basically all they cover is "background processing" part, and nothing about how to resubscribe to request after orientation change, etc.

    Any ideas or real-project stories, and especially libraries or code examples will be appreciated. Thanks in advance!

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

    Collaborating on strings.xml translation

    Posted: 20 Apr 2018 02:01 AM PDT

    What do you guys use to collaboratively translate the strings.xml file?

    I'm aware of Google Translator Toolkit, but are there any alternatives; i.e. one where it's easier to import/export from/to a table and collaborators don't necessarily require a Google account? Maybe even with the functionality to insert a screenshot?

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

    Anyone using mopub mediation? I think im doing something wrong

    Posted: 19 Apr 2018 08:28 PM PDT

    i have 8 ad networks connected for banners, interstitial, and rewarded video. The campaign has been running for 5 days now and I'm still at 0% fill for all networks.

    I do have some fill through the mopub marketplace but its only at about 15% fill rate and the ecpm is ridiculously low (0.06 for interstitial and 0.80 for rewarded video).

    Am i doing something wrong or is this normal?

    To compare, I was originally using admob only with no mediation and i was getting 100% fill and much higher ecpm.

    I've been averaging about 2,000 impressions per day since i launched the campaign. I know it's not a huge amount, but i should be seeing better results, right? Isn't the point of mediation to get better fill at a better price?

    Its kind of a failure when the interstitials only show up 2 out of 10 times they are supposed to show

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

    No comments:

    Post a Comment

    Fashion

    Beauty

    Travel